如何编写覆盖主题CSS的插件CSS

时间:2018-03-26 11:52:08

标签: html css

我为我的插件编写CSS,但主题CSS覆盖,我已经尝试并搜索了这个我没有得到任何解决方案

这是我的HTML代码

 <html>
 <body>
 <img src="sample.gif" width="100" height="132">
 <h1>This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</h1>
 </body>
 </html>

我的CSS是

 img {
       float: right !important;
     }

主题CSS是

  h1 {
       clear:both;
     }

我希望我的图像显示在h1标签的右侧。

1 个答案:

答案 0 :(得分:3)

只需删除标题上的清除...如果不可以,则覆盖它

&#13;
&#13;
img {
  float: right
}

h1 {
  clear: both !important
}

body h1 {
  clear: none !important
}
&#13;
<img src="sample.gif" width="100" height="132">
<h1>This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.</h1>
&#13;
&#13;
&#13;