简体   繁体   English

没有缩进的HTML Bullet点

[英]HTML Bullet point with no indent

I'm creating an html email and want to create bullet points without indent. 我正在创建一个HTML电子邮件,并希望创建没有缩进的项目符号。 Because it's an email it has to be html and inline CSS. 因为它是一封电子邮件,它必须是html和内联CSS。 Is there a way to edit your bullet settings? 有没有办法编辑你的子弹设置? These are multi line bullets. 这些是多线子弹。

Just put • 只是把• at the start of the line, instead of a list: 在行的开头,而不是列表:

&bull; List item here<br />
&bull; Another list item here

Renders as: 呈现为:

• List item here •此处列出项目
• Another list item here •此处的另一个列表项

This way you can be sure it will be consistent across email clients. 通过这种方式,您可以确保它在电子邮件客户端中保持一致。

Unordered list tag has a default padding assigned to it, you can override it by giving margin-left: -10px css. 无序列表标记具有分配给它的默认填充,您可以通过给出margin-left: -10px css来覆盖它。 this should resolve your issue. 这应该可以解决您的问题。

On giving a 0px padding you will end up losing your bullets. 在给出0px填充时,最终会丢失子弹。

Thanks 谢谢

You can assign a choice of two properties to alter position of bullet points: list-style-position: outside; list-style-position: inside; 您可以指定两个属性的选项来改变项目符号的位置: list-style-position: outside; list-style-position: inside; list-style-position: outside; list-style-position: inside;

Then adjust padding accordingly. 然后相应地调整填充。

See this example on Codepen . 在Codepen上查看此示例

You will still need to deal with display differences within individual email clients however. 但是,您仍然需要处理各个电子邮件客户端中的显示差异。

Just set the ULs margin and padding to zero. 只需将UL边距和填充设置为零即可。

<ul style="margin:0;padding:0">
  <li></li>
</ul>

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

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