<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
标签 html css image html-lists
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
我有一个无序列表的图像,我需要将它们水平显示在一行中,没有边距/填充或列表样式,我应该使用什么 CSS 来做到这一点?
这是我的html代码:
<div id="carouselContainer">
<ul id="carousel-list">
<li><a href="/"><img src="image.png" alt="Desc" /></a></li>
<li><a href="/"><img src="image.png" alt="Desc" /></a></li>
<li><a href="/"><img src="image.png" alt="Desc" /></a></li>
<li><a href="/"><img src="image.png" alt="Desc" /></a></li>
</ul>
</div>
这方面的任何帮助都会很棒
最佳答案
将 float 设置为左侧将使列表水平放置
li {
float: left;
}
关于html - 水平显示无序列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25444966/