html - Styling polymer - 一次适用于所有浏览器

标签 html css polymer

如何为所有浏览器设计一次 polymer 样式? 现在我必须为 Chrome/Opera 和 Firefox 编写两个 css 版本:

.leftSide img{
    float: left;
    width: 100px;
}
content[select=".poster"]::content img {
    float: left;
    width: 100px;
}

HTML:

        <div class="leftSide">
                <content select=".poster"></content>
        </div>

这仅适用于新的 Opera 和 Chrome:

content[select=".poster"]::content img

这只适用于 firefox:

.leftSide img{
    float: left;
    width: 100px;
}

那么,有没有一次性编写代码的选项?

最佳答案

你试过polyfill-next-selector了吗? Documentation for it here

有了它你应该能够做到:

polyfill-next-selector {content: ':host .leftSide img';}
content[select=".poster"]::content img {
    float: left;
    width: 100px;
}

关于html - Styling polymer - 一次适用于所有浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24629457/

相关文章:

javascript - 返回初始样式时的CSS动画

javascript - 显示隐藏的 div 并关闭其他的,因此一次显示 1

html - 在容器 div 内垂直对齐表格

html - 使用 webkit 变换比例增加 Safari 中复选框的大小

javascript - 计算的自定义属性不会显示在 Polymer 的页面上

html - 在文本框右侧添加 `fa fa search`

html - 垂直对齐 Bootstrap 导航栏

html - 如何屏蔽具有渐变背景的图像?

javascript - 将数据绑定(bind)到 Polymer 中的内容元素

internet-explorer - 在 IE 上的 <table> 或 <select> 中断中使用 dom-repeat