简体   繁体   English

如何正确缩进无序列表? margin-left不起作用!

[英]How do I indent an unordered list properly? margin-left won't work!

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 感谢您的帮助,关心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>

Less is more: 少即是多:

<ul>
    <li>Abc</li>
    <li>Def
       <ul>
           <li>Ghi</li>
           <li>Jkl</li>
       </ul>
    </li>
    <li>Mno</li>
</ul> 

You need to apply the margin-left: 0; 你需要应用margin-left: 0; to the li itself. 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. 还要检查该tabletd是否没有应用任何填充或边距。

.bullets, .bullets td, .bullets ul, .bullets li {
margin-left: 0;
padding-left: 0;
}

Hope this helps. 希望这可以帮助。

  .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>

Bullet缩进应该由margin-left控制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM