简体   繁体   English

CSS样式覆盖不适用于移动浏览器

[英]CSS style override doesn't work on mobile browsers

Here's my code in a css. 这是我在CSS中的代码。 It's overriding a style written in the HTML file. 它覆盖了HTML文件中编写的样式。 I don't have access to change the HTML. 我无权更改HTML。

body[style] {
    background-color: yellow !important ;
    background: solid;
}

Background changes to yellow just fine on desktop Chrome. 在台式机Chrome上,背景变为黄色就可以了。 Doesn't work on mobile Chrome for Safari on iphone. 在iPhone上的Safari浏览器上无法使用移动Chrome浏览器。

<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="margin-left: auto; margin-right: auto; width: 900px;">

请从您的body元素中删除bgcolor="#000000" ,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM