html - 如何设置此 <li> 的样式,使句子的第二行刚好在它的开头下方而不是在元素符号下方?

标签 html css

我的问题是如何让 li 的第二行从句子开头的正下方开始,而不是在箭头下方?

<ul class="arrow-list">
    <li>Clear and consistent brand identity</li>
    <li>+47.08% Increase in website registrations</li>
</ul>

.arrow-list li {
  color: #0054a6;
  margin-bottom: 4px;
  display: block;
}
.arrow-list li:before {
  font-family: 'ElegantIcons';
  speak: none;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  content: "\39";
  color: #0054a6;
  font-size: 18px;
  display: inline-block;
  margin-right: 18px;
  position: relative;
  top: 4px;
}

enter image description here

最佳答案

像这样:

.arrow-list li {
    position: relative;
    margin-left: 20px;
}
.arrow-list li:before{
    position: absolute;
    left: -20px;
}

http://jsfiddle.net/kz41hvfu/

关于html - 如何设置此 <li> 的样式,使句子的第二行刚好在它的开头下方而不是在元素符号下方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31628525/

相关文章:

javascript - 将 Canvas 调整为更大的图像并将其发送到服务器

css - Twitter Bootstrap 删除跨度的边距

css - Bootstrap 多列表单

html - 点击标签打不开选择

HTML/CSS - 删除顶部和侧边距

html - CSS:如何防止文本对布局造成严重破坏?

html - CSS 两个按钮彼此相邻,一个在表单中,一个不在表单中

html - 如何将背景色*放在* Bootstrap 按钮后面

css - 为什么 `white-space-collapsing` CSS3 属性的引入被推迟到 CSS-text-4(可能是 `text-space-collapse` )?

javascript - 元素中生效的神秘属性