如何在 CSS 中添加这样的缩进?
How can I add such an indentation in CSS?
据我所知,没有办法用纯 CSS 来完成你所要求的事情。我能想到的唯一解决方案是在要向下推的部分周围添加一个跨度,然后将相对高度设置为您的 line-height 的值(在本例中为 1em)。
line-height
1em
span { position: relative; top: 1em; }
http://jsfiddle.net/ptZkc/1/
您将会看到当跨度开始新行时出现问题,如上面的 jsfiddle 所示
As far as I know, there is no way to do what you're asking in pure CSS. The only solution I can think of is adding a span around the part you want pushed down, then setting the relative height to whatever your line-height is (in this case, 1em).
You will see an issue when the span starts a new line as exhibited in the jsfiddle above
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
据我所知,没有办法用纯 CSS 来完成你所要求的事情。我能想到的唯一解决方案是在要向下推的部分周围添加一个跨度,然后将相对高度设置为您的
line-height
的值(在本例中为1em
)。http://jsfiddle.net/ptZkc/1/
您将会看到当跨度开始新行时出现问题,如上面的 jsfiddle 所示
As far as I know, there is no way to do what you're asking in pure CSS. The only solution I can think of is adding a span around the part you want pushed down, then setting the relative height to whatever your
line-height
is (in this case,1em
).http://jsfiddle.net/ptZkc/1/
You will see an issue when the span starts a new line as exhibited in the jsfiddle above