我是CSS的新手,我想为ul
- li
添加一些父级ul.optiongroup
的额外间距。但是那些ul.optiongroup
还可以包含更多ul.optiongroup
和li
s。所以。这是html看起来像[Pl.see my old query for reference if required]和JsFiddle:
NESTED UL-LIs :
<div id="target" class="treeselector">
<div class="styledSelect">
Select
</div>
<ul class="optiongroup expand" rel="Home">
<li class="title">
<span> </span>Home
</li>
</ul>
<ul class="optiongroup expand" rel="Products">
<li class="title">
<span class="fa fa-minus-square-o"> </span>Products
</li>
<li rel="PCPROducts1" class="expand">
PCPROducts1
</li>
<li rel="PCPROducts5" class="expand">
PCPROducts5
</li>
<ul class="optiongroup expand" rel="PCPROducts6">
<li class="title">
<span class="fa fa-plus-square-o"> </span>PCPROducts6
</li>
<ul class="optiongroup" rel="6th Product">
<li class="title">
<span class="fa fa-plus-square-o"> </span>6th Product
</li>
<li rel="Digital">
Digital
</li>
<li rel="Analog">
Analog
</li>
</ul>
</ul>
</ul>
</div>
试图像这样添加CSS:
.optiongroup li{
margin-left:40px;
border: 1px red solid; /* Just to see what's happening there */
}
ul
- li
最简单的css最简单的方法是什么。答案 0 :(得分:1)
如果不需要,你会使用很多UL标签。
您可以尝试这样做:
autodoc
请注意,第二个UL在LI内部