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.
Float looks cleaner and easier.
I’ve tried it and it works.
Are there any cross browser compatibility issues?
Thanks a lot for your help.
May I ask why this step is necessary, surely the image is inside the <li> whether I user my original code or either of your methods, it shouldn’t make a difference.
With the current code there are no bugs, but you are treading on thin ice :). The <li> needs to be block level (aka floating does that) to contain the image.