gpt4 book ai didi

html - 在默认模板中覆盖样式

转载 作者:太空宇宙 更新时间:2023-11-04 00:43:57 24 4
gpt4 key购买 nike

我正在使用 wordpress 和一些插件主题。目前我的默认模板包含此属性。

  html {
margin-top: 32px !important;
}

我需要将它设置为 margin 0px。如何覆盖它?我试图在我的特定 CSS 中设置但不能。

最佳答案

!important携带最高级别specificity .

因此,只有两种方法可以覆盖它:

  • 再添加一个!important稍后在样式表中声明:html { margin-top: 0; }

html {
background: red !important;
}

html {
background: blue !important;
}
<html></html>

  • 或添加内联 !important声明:<html style="margin-top: 0 !important;">

html {
background: red !important;
}
<html style="background: blue !important;"></html>

关于html - 在默认模板中覆盖样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57667483/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com