【发布时间】:2016-06-23 13:11:56
【问题描述】:
我在 Chrome 开发者工具窗口的“样式”标签中看到了这段 css 代码:
element.style {
height: auto;
width: 100%;
margin-top: -148px;
}
我想在我的 .css 文件中用这个 css 代码覆盖它:
.so-widget-sow-simple-masonry-simple-masonry-d75171398898 .sow-masonry-grid-item img {
width: auto;
height: 244px;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
}
但是element.style 的样式定义已经存在。
我找不到 .js 这么快。
有人能帮我吗?
谢谢
【问题讨论】:
-
尝试通过为值添加 !important 来覆盖首选项.. 但这是不可取的...
-
好的,这行得通,但还有其他解决方案吗?
-
您可以检查stackoverflow.com/questions/2465158/… 以删除特定的内联样式
标签: javascript html css siteorigin