Html 如何正确缩进无序列表?左边距不起作用!
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1920575/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I indent an unordered list properly? margin-left won't work!
提问by brightmist.co.uk
Hi I'm creating an email but I'm not sure how to adjust the automated indent on the bullets. I'm sure theres a simple fix. Margin-left doesn't seem to work!
嗨,我正在创建电子邮件,但我不确定如何调整项目符号上的自动缩进。我确定有一个简单的修复方法。左边距似乎不起作用!
Thanks for your help Regards Judi
感谢您的帮助 问候朱迪
.bullets{
width:255px;
color:white;
font-size:11px;
margin-right: 2em;
list-style: none;
line-height:15px;
list-style: none;
margin-left: 0;
padding-left: 1em;
display:inline;
}
<table class="bullets" border="0">
<tr>
<td><ul>
<li> Select products
</li>
</ul></td>
</tr>
<tr>
<td>
<ul>
<li> Incorporate </li>
</ul></td>
</tr>
<tr>
<td><ul>
<li> on site</li>
</ul></td>
</tr>
</table></td>
回答by graphicdivine
Less is more:
少即是多:
<ul>
<li>Abc</li>
<li>Def
<ul>
<li>Ghi</li>
<li>Jkl</li>
</ul>
</li>
<li>Mno</li>
</ul>
回答by limitlessloop
You need to apply the margin-left: 0;
to the li
itself.
你需要应用margin-left: 0;
到li
自身。
.bullets li {
margin-left: 0;
padding-left: 0;
}
You might find you also need to apply it to the ul
aswell.
您可能会发现您还需要将其应用到该文件中ul
。
.bullets ul, .bullets li {
margin-left: 0;
padding-left: 0;
}
Check also that that table
and td
do not have any padding or margin applied to them.
还要检查table
并td
没有对它们应用任何填充或边距。
.bullets, .bullets td, .bullets ul, .bullets li {
margin-left: 0;
padding-left: 0;
}
Hope this helps.
希望这可以帮助。
回答by Sarfraz
.bullets{
width:255px;
color:white;
font-size:11px;
margin-right: 2em;
list-style: none;
line-height:15px;
list-style: none;
margin-left: 0;
padding-left: 1em;
display:inline;
}
<table class="bullets" border="0">
<tr>
<td>
<ul>
<li> Select products</li>
<li> Incorporate </li>
<li> on site</li>
</ul>
</td>
</tr>
</table>
回答by DanDan
The Bullet indent should be controlled by margin-left.
Bullet 缩进应该由 margin-left 控制。