如何在包裹成多行的跨度中对齐缩进线? [英] How to align an indented line in a span that wraps into multiple lines?

查看:57
本文介绍了如何在包裹成多行的跨度中对齐缩进线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何对齐第二行吗?

Does anyone have an idea how to align the second line?

span.info {
  margin-left: 10px;
  color: #b1b1b1;
  font-size: 11px;
  font-style: italic;
  font-weight: bold;
}

<span class="info"></span>

推荐答案

display:block;

然后您将获得一个block元素,并将边距添加到所有行中.

then you've got a block element and the margin is added to all lines.

虽然跨度在语义上确实不是块元素,但在某些情况下您无法控制页面DOM.这个答案确实适合那些人.

While it's true that a span is semantically not a block element, there are cases where you don't have control of the pages DOM. This answer is inteded for those.

这篇关于如何在包裹成多行的跨度中对齐缩进线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆