<ul id='ul01'>
<li><a href='#'><img src='img01.png' width="700" height="590" /></a></li>
<li><a href='#'><img src='img02.png' width="700" height="590" /></a></li>
<li><a href='#'><img src='img03.png' width="700" height="590" /></a></li>
</ul>
CSS:
#ul01{list-style:none;width:??;}
#ul01 li{float:left;}
This is a horizontal array of images. list.items.count can vary.
What should be the width property to fit all images.
I tried with - auto - and expected resizible width - but it's not.
You just put width property to ul element.
Yes, ul is a block level element so it takes full width. If you want to specify element width you can use inline-block.
Make the li
elements inline-block
s and set the white-space
property of the ul
to nowrap
.
li {
display: inline-block;
}
ul {
white-space: nowrap;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With