Hi,
I'm trying to make a simple image gallery using an unordered list.
The issue I'm having is that the list item only contains an image, I want the <li> to expand to the size of the image.
I assign a thin border to the list item to see where it ends and it doesn't seem to encompass the image.
I know I could just apply a border to the image itself, or manually make the <li> the size of the image, but I'd rather do it this way as I personally think it's the most logical way.
Any suggestions are welcome.Code:#myImageGallery li{ display:inline; } #myImageGallery li img{ height:100px; width:100px; } #myImageGallery li{ border:1px solid #000000; padding:0; margin:0; } <ul id='myImageGallery'> <li> <img src="images/test1.jpg" alt=""/> </li> </ul>
Thanks.





. The <li> needs to be block level (aka floating does that) to contain the image.
.


Bookmarks