I have been trying to create LI elements with float left and an image (as a "block") inside of them. The code works fine in all browser, except for IE 7 (and 6), where the LI are organized vertically instead of horizontally. What should I change in order for the code to work well in IE7? (you can find the code at http://jsbin.com/ilexa/edit as well) .
CODE:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssreset/reset-min.css">
<style>
ul {
width:700px;
}
li {
float:left;
margin:10px;
}
li img {
display:block;
margin: 0 auto ;
width:50px;
height:50px;
}
</style>
</head>
<body>
<ul>
<li><img src="http://dummyimage.com/50x50/000/fff" /></li>
<li><img src="http://dummyimage.com/50x50/000/fff" /></li>
<li><img src="http://dummyimage.com/50x50/000/fff" /></li>
<li><img src="http://dummyimage.com/50x50/000/fff" /></li>
<li><img src="http://dummyimage.com/50x50/000/fff" /></li>
<li><img src="http://dummyimage.com/50x50/000/fff" /></li>
</ul>
</body>
</html>