如何调整ul width属性? [英] How to adjust ul width property?
本文介绍了如何调整ul width属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<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:
CSS:
#ul01{list-style:none;width:??;}
#ul01 li{float:left;}
这是图像的水平阵列。 list.items.count可能会有所不同。
什么应该是宽度属性,以适应所有图像。
我试过 - 自动 - 和预期可重复宽度 - 但它不是。 li 元素
内嵌块
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.
推荐答案
/ code> s并将 ul
的空格
属性设置为 nowrap
。
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;
}
这篇关于如何调整ul width属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文