为什么当容器具有 :before/:after 伪元素时,文本缩进不起作用? (FX/歌剧)

发布于 2024-12-08 08:52:19 字数 260 浏览 8 评论 0原文

今天遇到这个怪事。

http://jsfiddle.net/UJAjD/3/

您会注意到,在 Firefox 7 和 Opera 中,灰色框有里面有“下一个”这个词。 CSS 包含一个 text-indent 属性,该属性应将该文本移出其容器。在 IE 或 Chrome 中查看此页面会按应有的方式显示。至少是您认为应该显示的方式。

这是一个已知的错误吗?有解决方法吗?

Ran into this quirk today.

http://jsfiddle.net/UJAjD/3/

You'll notice that in Firefox 7 and Opera, the gray box has the word "Next" in it. The CSS includes a text-indent property that should move that text outside of its container. Viewing this page in IE or Chrome shows it the way it should. At least the way that you would think it should show.

Is this a known bug? Is there a workaround?

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

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

发布评论

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

评论(1

乖乖 2024-12-15 08:52:19

根据规范,文本缩进会影响块的第一个行框中的文本。

问题在于规范并没有真正明确本例中的第一行框是否包含块或文本,并且不同的 UA 对规范的解释不同......

Per spec, text-indent affects the text in the first line box of the block.

The problem is that the spec doesn't really make it clear whether the first line box in this case contains the block or the text, and different UAs interpret the spec differently...

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