Forum Moderators: not2easy

Message Too Old, No Replies

floating div issue

         

ramiro77

4:59 am on Feb 18, 2008 (gmt 0)

10+ Year Member



<snip>

Basically the green box is a float:left

How do I get it to stay in the container div ?

Apologize for the bad code, I am just trying things.

[edited by: SuzyUK at 9:31 pm (utc) on Feb. 18, 2008]
[edit reason] Please No URI's [/edit]

SuzyUK

9:35 pm on Feb 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hiya ramiro77

try a search for 'containing floats'

simple terms: floats are removed from the flow, so the parent element does not know that they are there, let alone how tall they are

Solutions:
put something "real" after the floats, (a clearing div?)
try "easyclearing",
or use one of the recommended CSS methods which is to set the parent elemnt to float also - not always best if container is centered - or set the parent to overflow: auto or hidden

- choice is yours ;)