I have a div with 5 images in a row that are 300px each. With a 10px margin on each side they should fit in my div at 1600px wide but the last image is bumping to the next line. Why is it not fitting? After some trial and error I see that when I adjust my margins to 8.5px they fit correctly but that doesn't seem to make sense?? I don't have any other borders, padding, etc.
Here is my CSS:
#wrap {
width: 1600px;
margin: 0 auto;
background-color: red;
}
.image {
width: 300px;
margin: 8px 10px 0 10px;
vertical-align: text-top;
}
My HTML looks something like this:
<div id="wrap">
<div id="portfolio">
<section>
<a><img></a>
<a><img></a>
<a><img></a>
<a><img></a>
<a><img></a>
</section>
<section>
<a><img></a>
<a><img></a>
<a><img></a>
<a><img></a>
<a><img></a>
</section>
</div>