gpt4 book ai didi

css - 从子主题中删除样式

转载 作者:行者123 更新时间:2023-11-28 17:50:00 25 4
gpt4 key购买 nike

我正在使用 wordpress,想删除我父主题样式的某个方面,但也不想触及父主题的 styles.css。因此我想从子主题的样式表中删除该元素,但我该怎么做呢?

现在我的子主题通过

调用我的父主题样式
@import url("../parenttheme/style.css");

现在我想删除

的整个部分
@media only screen and (max-width: 767px) { 
.container { max-width: 95% }
.sidebar-container { padding: 0; margin-top: 50px; }
.masthead-right { display: none }
.single-nav { position: inherit; top: auto; right: auto; margin: 20px 0 0; }
.single-nav-left, .single-nav-right { margin-left: 0; margin-right: 3px; }
.comment-list .children { margin-left: 0 }
#copyright, #footer-menu { text-align: center }
#footer-menu ul { float: none; margin-top: 5px; }
#footer-menu li { float: none; display: inliene; display: inline-block; margin-left: 0; margin-right: 10px; }
.related-posts .span_6, .related-posts .span_18, .related-posts .span_8 { width: 100%; padding: 0; }
.related-posts .span_8, .related-posts .span_6 { margin-bottom: 1.5em }
.tax-archives-filter { position: inherit; position: relative; top: auto; right: auto; margin: 30px 0 0; }
.tax-archives-filter > li { width: 100%; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; }
.tax-archives-filter i { position: absolute; top: 50%; margin-top: -5px; right: 13px; }

}在我的父主题样式中调用它并将其从子主题中取消。

最佳答案

如果您只需要重置该特定行,只需将其设置为

.masthead-right{
float:none;
}

忠告,永远不要在父级 CSS 上工作。更改子主题 css 或添加新的 custom.css 并将其声明在您希望覆盖的 css 正下方

编辑

刚刚精神焕发,注意到 gaynorvader 提出了同样的建议......

关于css - 从子主题中删除样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22485499/

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