redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers

Ask your IT question here

how can I have two div


Goto page 1, 2  Next
 
Post new topic   Reply to topic    Programming Forums -> HTML forum
View previous topic :: View next topic  
Author Message
jomanda
Enthusiastic Coder


Joined: 19 May 2006
Posts: 70
Location: Germany
How can I have two div as though they were <table><tr><td></td><td></td></tr></table> ?

Reply with quote
 
AmeliaR
Enthusiastic Coder


Joined: 31 May 2006
Posts: 142
by floating them
Reply with quote
 
jomanda
Enthusiastic Coder


Joined: 19 May 2006
Posts: 70
Location: Germany
yes, that works, but creates a problem... the content that follows the div "table" doesn't follow at the end of the container div
Ie: <div><div style="float: left">content</div><div>content</div></div>
Content that follows that bit isn't below the container div
It's usually directly under 2nd column div

Reply with quote
 
AmeliaR
Enthusiastic Coder


Joined: 31 May 2006
Posts: 142
yes, it takes some mastery of css layout techniques. can you easily apply a clear: both; on the element that follows the two floated divs?
Reply with quote
 
jomanda
Enthusiastic Coder


Joined: 19 May 2006
Posts: 70
Location: Germany
that's hwat i wanted to avoid
Wink

Reply with quote
 
AmeliaR
Enthusiastic Coder


Joined: 31 May 2006
Posts: 142
do the two divs have a containing div?
Reply with quote
 
jomanda
Enthusiastic Coder


Joined: 19 May 2006
Posts: 70
Location: Germany
Yes
Reply with quote
 
AmeliaR
Enthusiastic Coder


Joined: 31 May 2006
Posts: 142
apply these css properties: width: 100%; overflow: auto;
jomanda: the properties will turn the containing div into hasLayout in IE, so it will grow to contain the floats.

Reply with quote
 
jomanda
Enthusiastic Coder


Joined: 19 May 2006
Posts: 70
Location: Germany
Ah, does that work for all browsers?
Reply with quote
 
AmeliaR
Enthusiastic Coder


Joined: 31 May 2006
Posts: 142
and in other browsers, the overflow: auto; will make it grow to contain floated element, as per spec.
Reply with quote
 
Page 1 of 2 Goto page 1, 2  Next
Post new topic   Reply to topic    Programming Forums -> HTML forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group