html - 元素符号内缩进 <li>

标签 html css

您好,我对要点右侧的缩进有疑问

我添加了一段代码和一张图片,可以很好地解释其自身

Image1

 <h1 style="display: block;margin: 0;padding: 0;color: #000000;font-family: Helvetica;font-size: 26px;font-style: normal;font-weight: bold;line-height: 125%;letter-spacing: normal;text-align: left;"><span style="font-size:28px"><strong><span style="color:#96c11f">Why now</span></strong></span></h1>    
<ul>
<li><span style="font-size:16px">Increase in buyers looking for businesses over the Christmas period.</span></li>
<li><span style="font-size:16px">More sales agreed in January so be on the market in time.</span></li><br>
</ul>

最佳答案

尝试减少 li 的边距以使元素符号向左移动,并增加/减少其 padding 以适应您想要的元素符号和文本之间的距离。

h1 {
  display: block;
  margin: 0;
  padding: 0;
  font-family: Helvetica;
  font-style: normal;
  font-weight: bold;
  line-height: 125%;
  letter-spacing: normal;
  text-align: left;
  font-size: 28px;
  color: #96c11f;
  font-weight: bold;
}
ul {
  font-size: 16px;
  padding:0;
  margin-top:0;
}
ul li{
  margin-left:1em;
  padding-left:0;
}
<h1>Why now</h1> 
<ul>
  <li>Increase in buyers looking for businesses over the Christmas period.</li>
  <li>More sales agreed in January so be on the market in time.</li>
  <br>
</ul>

关于html - 元素符号内缩进 <li>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40928051/

相关文章:

javascript - 尝试在 PHP 中调用 jQuery - 不起作用?

jquery - 在 Bootstrap 汉堡包按钮内垂直居中文本

.net - 在 Razor 应用程序的 View 中使用特殊的法语字符

php - Wordpress 页面无法为少数用户正确呈现

javascript - 单击时 d3.js 分层边缘捆绑节点颜色更改

javascript - Ruby on Rails 和 Jquery : trying to switch characters after submit

php - 在 php 中将 html 转换为 pdf?

php - 如何从 WordPress 内容中提取图像?

javascript - 从 html img 标签更改一个 svg 元素的颜色 - css

html - 带子菜单的纯 css 垂直菜单