Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extra space at the bottom of div float container

Tags:

css

css-float

This is the current setup:

<div id="youtubelatestnews">
    <div class="box youtubebox">
    </div>

    <div class="latestnews">
    </div>

    <div class="clear"></div>
</div>

But the problem is the container <div> which is "youtubelatestnews" has too much space at the bottom.

Here's the site: http://voila.easywebprojects.com/

The <div>s I'm referring to are the sneak peek & Latest News portion.

like image 432
Laurize Avatar asked Sep 14 '11 08:09

Laurize


2 Answers

The reason for the extra space is the clear div, which will clear below the elements on the left also.

You can remove the clear div, and use overflow: hidden; on the #youtubelatestnews div. As you don't have a height specified for it, the overflow style will only make the element contain its children.

like image 187
Guffa Avatar answered Nov 15 '22 01:11

Guffa


Try to add float:left; style to youtubelatestnews div, it worked for me ;-)

like image 34
Gatekeeper Avatar answered Nov 15 '22 03:11

Gatekeeper