如何覆盖css中包含的css

时间:2016-01-19 05:20:59

标签: html css css3

我在复杂的webapp中有代码 - 就是创建像这样的代码

{{1}}

如何插入css(通过.css文件包含)来覆盖宽度和高度?

感谢

4 个答案:

答案 0 :(得分:1)

您可以覆盖此图像样式,如下面的方法



img[style]{
        height:100px !important;
        width:200px !important;
    }

<img src="http://www.keenthemes.com/preview/conquer/assets/plugins/jcrop/demos/demo_files/image1.jpg" style="width:369px;height:200px">
&#13;
&#13;
&#13;

答案 1 :(得分:0)

用于!important并在class标记中定义img,如下所示

.imgClass{
width:400px !important;
height:400px !important
}

答案 2 :(得分:0)

使用覆盖所有内容的!important方法强制使用CSS:

选中此fiddle

img {
  width: 500px !important;
  height: 500px !important;
}

答案 3 :(得分:0)

您应该像这样将!important添加到您的风格中。

img {
    height: 200px !important;
    width: 369px !important;
}

然后我总是建议你不要做内联风格。