Reputation: 2199
I am working on an HTML CSS template, i stuck in a situation in which my list item (li) is getting bottom-margin from somewhere, here is my code:
HTML
<div id="main-4">
<ul>
<li>
<img src="http://demo.htmlcoder.me/ivega/images/portfolio-1.jpg" alt="#">
</li>
<li>
<img src="http://demo.htmlcoder.me/ivega/images/portfolio-2.jpg" alt="#">
</li>
<li>
<img src="http://demo.htmlcoder.me/ivega/images/portfolio-3.jpg" alt="#">
</li>
<li>
<img src="http://demo.htmlcoder.me/ivega/images/portfolio-4.jpg" alt="#">
</li>
</ul>
</div>
CSS
#main-4 ul li {
list-style-type: none;
float: left;
width: 337px;
}
#main-4 ul li > img {
width: 337px;
}
Upvotes: 1
Views: 102
Reputation: 130195
it's because images do that. give your images vertical-align:bottom
and see how it's being fixed:
#main-4 ul li {
list-style-type: none;
float: left;
width: 337px;
}
#main-4 ul li > img {
width: 337px;
vertical-align:bottom;
}
Upvotes: 3