您好,我正在尝试注入自定义css到一个页面,我的清单文件如下
{
"name": "SaneHaveeru",
"version": "1.0",
"description": "This is to properly display haveeru .",
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": ["http://www.haveeru.com.mv/*"],
"css" : ["proper.css"]
}
],
"permissions": [
"http://www.haveeru.com.mv/"
]
}我注入的css是
.post-frame {
float: left;
width: 470px;
font-size: 18px;
line-height: 30px;
color: #292929;
}但是似乎页面css覆盖了我的自定义css。如图所示

是他们强迫我的css改变到页面上的方式吗?
干杯纳什·拉菲克
发布于 2012-02-03 15:25:02
将!important放在所有css规则的末尾...
.post-frame {
float: left !important;
width: 470px !important;
font-size: 18px !important;
line-height: 30px !important;
color: #292929 !important;
}发布于 2012-02-03 12:59:54
使用JavaScript设置样式。它将覆盖任何页面样式。
https://stackoverflow.com/questions/9123795
复制相似问题