I am suffering the same problem another StackOverflow user asked here: link. The solution was to use the following CSS on the container (div):
display:table;
width:100%;
However, I have a border at the bottom of my div and now there is a gap between the content of the div and the border.
Does anyone know how to remove this gap?
Edit:
The CSS of the container:
background-image:url('images/header.jpg');
background-repeat:repeat-x;
border-bottom-color:black;
border-bottom-style:solid;
border-bottom-width:5px;
font-size:small;
font-weight:bold;
It may also be worth me adding that inside this container is another div with the following CSS:
#header
{
clear:both;
height:50px;
margin-left:auto;
margin-right:auto;
width:900px;
}
#header > *
{
float:left;
}
And some HTML:
<div id="header-container">
<div id="header">
</div>
</div>