Mobile app version of vmapp.org
Login or Join
Jessie594

: Clearing floats? Or something else? I'm working on this website for my dad: http://smartcampusdeals.com/TendonAiD/index3.html and the three columns (with the stick cartoony people) extend past the

@Jessie594

Posted in: #Css #Html

I'm working on this website for my dad: smartcampusdeals.com/TendonAiD/index3.html
and the three columns (with the stick cartoony people) extend past the container. Right now, I have the container set at a static height (700px or something) but I want the height to adjust, so I don't have to change it for every other page. Why are these three columns behaving that way and what can I do to fix it?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie594

2 Comments

Sorted by latest first Latest Oldest Best

 

@Fox8124981

I've used several different approaches for this problem in the past.

The best one so far is:
#logos { zoom: 1; overflow: hidden; }

Basically just setting the container of the floats to overflow: hidden or auto fixes this behavior in most browsers.

Of course this doesn't always work in IE (what else is new). That's what the zoom: 1; is for.

10% popularity Vote Up Vote Down


 

@Pope3001725

This is the classic 'collapsed parent' problem, created by floating an element, but not its parent. In your case you have a float on #feature -text and its children, but not #content -wrapper.

There are four CSS solutions, although one of the main two should work for you:

Either add another clear float - <div class="clear"></div> - at the end of the content wrapper, or give the content wrapper the css overflow:hidden.

This good article explains the theory and the other two possible solutions:
www.smashingmagazine.com/2009/10/19/the-mystery-of-css-float-property/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme