Centering floating list items <li> inside a div or their <ul>
问题 HTML: <div class="imgcontainer"> <ul> <li><img src="1.jpg" alt="" /></li> <li><img src="2.jpg" alt="" /></li> ..... </ul> </div> I'm coding a simple gallery page by creating unordered list and each list item of it contains an image. ul li { float: left; } I set the width of the container as "max-width" so I can make possible to fit the list items (images) to the browser width.. meaning that they will be re-arranged when the browser window re-sized. .imgcontainer{ max-width: 750px; } Now the