Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
text alignment against div alignment
Old 05-31-2005, 06:59 AM text alignment against div alignment
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
Hi all,

I have 2 divs,
<style>
#main { position:relative;
width:400px;
height:300px;
top:0;
left:0px;
}

#photo { position:relative;
right:0px; top:0px;
height:100px;
background-color:#cccccc;
}
</style>
<div id="main">
sample text here sample text here sample text here sample text
here sample text here sample text here sample text here sample text here
<div id="photo"></div>
</div>

My problem is this :

I don't want the text to show behind in the child div photo.
How do i do this.

cheers

Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 05-31-2005, 11:36 AM
praveen's Avatar
Life is a Dream

Posts: 3,591
Name: Praveen
Location: Chennai, India
Trades: 0
Quote:
don't want the text to show behind in the child div photo.
what exactly are you looking at doing?

it doesnt show "behind".. infact it shows above the photo..

wat browser u r using?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
praveen is offline
Reply With Quote
View Public Profile
 
Old 05-31-2005, 11:48 AM
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
Ok sorry,

I dont want the text to be behind or in front. When text reaches the edge of the photcell, i want it to auto wrap to the next line and NOT show anything behing or infront of. I suppose i should have specified a width 100px as well.

cheers
__________________

Please login or register to view this content. Registration is FREE

Last edited by numbenator; 05-31-2005 at 11:53 AM..
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 05-31-2005, 02:08 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
something along the lines of this Photo Gallery layout ?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-31-2005, 03:40 PM
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
No. Not as such.

This is the page im working on.

http://www.mastech-solutions.com/Kin...stimonials.htm

You see the photo is a quarter of the size that the text take up and there more text that can be shown in the heights worth of the image.

Ive had to define the text in each testimonial within 2 divs. This isn't practical when the text is coming from CMS as it will be one content and not split in two to enable rendering in divs.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 06-01-2005, 04:26 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
setting a float:right on the image should work

Code:
#main img {
position:relative;
float:right;
margin:0px 2px 10px 10px;
}
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2005, 05:03 AM
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
This now places the box after the text and doesnt position it in the top right of the screen. I dont want the picture to change position after the text has been placed.
The text must overflow arround the picture and the down the page.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 06-01-2005, 09:16 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If the picture is in the child div (#photo) you will need to make the child div float right instead.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2005, 09:34 AM
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
thats what I am doing and as you said i should od in your previous response. It leaves the imgDiv, at the end of the text.
This just doesnt work how your suggesting.
Heres the code i thin kyou are suggesting,
<style>
#main { position:relative;
width:400px;
height:300px;
top:0;
left:0px;
}

#photo { float:right;

height:100px;

background-color:#cccccc;
}
</style>
<body>

<div id="main"> sample text here sample text here sample text here sdfgfggfdg
ample text here sample text here sample text here sample text here sdfgfggfdg
ample text here sample text here sample text here sample text here sample text
here dfgfdg dfg dfjkhdf kfg klhfd h ldfg kldfghsample text here sample text here sample text here sample text
here dfgfdg dfg dfjkhdf kfg klhfd h ldfg kldfghj jfdk fhdj
<div id="photo">image here</div>
</div>

You notice if you run that the box just slips to the base of the text
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 06-01-2005, 10:01 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yes, which is exactly what it should do, because that's where it is in the document flow. If you want it at the top it will have to be before the text in the flow.

You can of course take objects out of the flow with position:absolute; but this means they will be unaffected by other objects and conversely other objects will not be affected by them, which is why the text will go "behind" the image.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2005, 10:05 AM
numbenator's Avatar
Webmaster Talker

Posts: 523
Location: London
Trades: 0
Thanks for your time. Thats exactly what I want to do and thought we were talkaing about. Obviously the box will be at the bottom of text in the flow of things however as I said in my oriiginal topic and laters ones with a link showing example of whaere , I wish the image to remain in the top right of the container cell.

I know I can position absolute. however this will not work ion the over schem of the page. ( i think)
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Reply     « Reply to text alignment against div alignment
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35870 seconds with 12 queries