ric*_*sso 5 html css google-chrome css-selectors
我有以下HTML代码,我想用css格式化一种无法更改的数据格式(来自xml).
我必须为具有不同属性值的元素提供不同的样式.我想使用CSS属性选择器.
body {
background-color: black
}
s {
text-decoration: none
}
f {
color: black;
text-decoration: none;
display: block;
}
f[type=h2] {
color: green
}
f[type=p] {
color: blue
}
f[type=speech] {
color: yellow
}
f[type=other] {
color: gray
}
Run Code Online (Sandbox Code Playgroud)
<b>
<s>
<f type="h2">Title</f>
<f type="p">Paragraph</f>
<f type="speech">Dialgoue</f>
<f type="other" br="true">Other</f>
<f type="p">Paragraph</f>
<f type="p">Paragraph</f>
</s>
</b>
Run Code Online (Sandbox Code Playgroud)
在Firefox中,页面按照我的预期呈现(h2绿色,p蓝色,speech黄色和其他灰色).在chrome中,一切都是绿色的.
如何在Chrome中获取Firefox结果?