Mar*_*rin 8 css firefox fonts google-chrome text-rendering
font-variant: small-caps;
font-size: 12px;
Run Code Online (Sandbox Code Playgroud)
火狐:
铬:
如何在不使用JavaScript的情况下协调一致?
您可以使用 css hack 单独定位浏览器,如下所示:
@-moz-document url-prefix() {
//firefox specific css here
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
//chrome specific css here - this will also hit other webkit browsers like safari tho
}
Run Code Online (Sandbox Code Playgroud)
然而,在我看来,更好的方法是使用一点点 JavaScript 来检测浏览器并在 html 元素上设置一个类,然后您可以使用该类作为针对各个浏览器的基础。
最后它看起来像这样:
<html class="firefox">
...
</html>
.firefox .rulename {
//firefox specific css here
}
Run Code Online (Sandbox Code Playgroud)
当然对于 Chrome 和其他浏览器也是如此
归档时间: |
|
查看次数: |
4203 次 |
最近记录: |