在HTML和CSS中缩进列表 [英] Indent List in HTML and CSS
本文介绍了在HTML和CSS中缩进列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新来的CSS和使用列表。我尝试使用我在w3schools上看到的一个代码,它显示了如何缩进列表:
I'm new to CSS and working with list. I tried using one of the code I saw on w3schools which shows how to indent lists:
<html>
<body>
<h4>A nested List:</h4>
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
</body>
</html>
我的css覆盖了它,因此它在同一垂直线上都显示了。有没有我可以在列表本地使用的任何CSS代码来覆盖主要的CSS文件?任何帮助,将不胜感激。
My css is overriding it so it all apears on the same vertical line. Is there any CSS code I could use locally on the list to override the main css file? Any help would be appreciated.
推荐答案
是的,只需使用类似:
ul {
padding-left: 10px;
}
并且它会颠倒每一个 ul
10像素。
And it will bump each successive ul
by 10 pixels.
这篇关于在HTML和CSS中缩进列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文