我想更改我的 wordpress 小部件区域行的背景颜色。我正在寻找要添加到我的 style.css 中的最后一个 css 代码,它将黑色变成奶油色:#fcf8ee
我目前有:
.widget {
background-color: #fcf8ee;
color: #000;
}
<div class="footer-widgets" id="genesis-footer-widgets">
<h2 class="genesis-sidebar-title screen-reader-text">Footer</h2>
<div class="wrap">
<div class="widget-area footer-widgets-1 footer-widget-area">
<section id="text-2" class="widget widget_text">
<div class="widget-wrap">
<div class="textwidget">
<p>...</p>
</div>
</div>
</section>
</div>
<div class="widget-area footer-widgets-2 footer-widget-area">
<section id="text-4" class="widget widget_text">
<div class="widget-wrap">
<div class="textwidget">
<p>...</p>
</div>
</div>
</section>
</div>
<div class="widget-area footer-widgets-3 footer-widget-area">
<section id="text-3" class="widget widget_text">
<div class="widget-wrap">
<div class="textwidget">
<p>...</p>
</div>
</div>
</section>
</div>
</div>
</div>
我已经尝试过 .widget-wrapper .footer-socket-wrapper 和 .widget-title 我错过了什么?
最佳答案
我查看了您的网站(地址可以从图像附件中收集到)并编辑了帖子以包含您的页脚代码的简化版本。 Using the browser's devtools/inspector ,您可以看到背景颜色应用于整个 .footer-widgets
区域,因此选择此选项以获得所需结果是一个简单的修复:
.footer-widgets {
background-color: transparent;
color: #000000;
}
您可以指定与页面相同的背景颜色,但如果您将背景颜色设置为透明,那么您不必担心在页面背景颜色发生变化时更改这行代码。
.widget
选择了一些 child ,但是你需要得到 parent 。熟悉 devtools 是了解和调试此类问题的最佳方式。祝你好运!
关于css - Wordpress 小部件区域背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49439578/