【问题标题】:Custom elements and :before :after自定义元素和 :before :after
【发布时间】:2014-09-03 23:04:07
【问题描述】:

在最新的 Chromium 37 中,我没有成功在自定义元素上使用 :before:after。使用 Polymer Platform polyfill 在其他浏览器中一切正常,但在原生支持的 Chromium 中却不行。

这样的样式:

my-element:before {
    background : #000;
    content    : '';
    display    : block;
    height     : 10px;
    width      : 10px;
}

我在这里错过了什么?

【问题讨论】:

    标签: polymer web-component shadow-dom


    【解决方案1】:

    您的示例在 Chrome 38 中适用于我:http://jsbin.com/lanatuhojowu/1/edit

    注意::host::before:host::after 不起作用是 Chrome 37 中的一个错误 (crbug.com/393509)。这应该有望在 Chrome 的下一个版本 (38) 中实现,并且肯定在 Chrome 39 中。

    【讨论】:

    • 谢谢你,我虽然这可能是错误,但没有发现任何相关的。
    猜你喜欢
    • 1970-01-01
    • 2011-06-22
    • 2012-12-01
    • 2020-09-20
    • 2011-04-02
    • 2014-12-25
    • 1970-01-01
    • 2015-09-12
    • 1970-01-01
    相关资源
    最近更新 更多