CSS 缩进到最后一行

发布于 12-18 00:25 字数 93 浏览 4 评论 0原文

如何在 CSS 中添加这样的缩进?

在此处输入图像描述

How can I add such an indentation in CSS?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

肥爪爪2024-12-25 00:25:05

据我所知,没有办法用纯 CSS 来完成你所要求的事情。我能想到的唯一解决方案是在要向下推的部分周围添加一个跨度,然后将相对高度设置为您的 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).

span {
 position: relative;
 top: 1em;
}

http://jsfiddle.net/ptZkc/1/

You will see an issue when the span starts a new line as exhibited in the jsfiddle above

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文