Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<Div> Tags in a line?

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi,

I want to have 3 div tags, a left, centre and right one all on the same line so the tops are all parallel. Unfortuantley it seems each one fits under the next, like steps. How can I get around this?

Cheers

James
 
<div style = &quot;border: thin solid black; position: absolute; left: 0; right:0&quot;>
AAA
</div>

<div style = &quot;border: thin solid black; position: absolute; left: 100; right:0&quot;>
BBB
</div>

<div style = &quot;border: thin solid black; position: absolute; left: 200; right:0&quot;>
CCC
</div>


vlad
 
Use SPAN instead.

Code:
<span>nose</span><span>eyes</span><span>lips</span>

Hope that helps.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
<div> has built in <p>(seperation) action
<span> does not.
 
If you really want to use the <DIV> tag. You can surround all three of your <DIV>s with yet another <DIV>. In the parent <DIV> give it a position: relative; so that it will float with the other code in the page around it. And all the child <DIV>s will have position: absolute; left: 100px; with the left value being set by you for best viewing.

This is similar to Vlad's post with the only benefit that you can put these <DIV>s wherever you wish on the page.

I still think that Ed's answer is probably the most complete and succinct.

Einstein47
(&quot;Vision without action is a daydream - Action without vision is a nightmare. Japanese Proverb&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top