CSS 如何更改css中的页脚背景颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42847629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I change the footer background color in css?
提问by azone
I am having trouble changing the footer background colour in my CSS doc.
我在更改 CSS 文档中的页脚背景颜色时遇到问题。
footer{ background-color: lightblue; text-align: center; }
I also can't change the aside background color.
我也无法更改旁边的背景颜色。
aside{ background-color: lightgray; }
I would really appreciate the help.
我真的很感激你的帮助。
回答by BioGenX
You can use a div inside the footer. See bellow fiddle:
您可以在页脚内使用 div。见波纹管:
.site-footer {
background: orange;
}
#footer-content {
background: red;
}
<footer class="site-footer">
<div id="footer-content">
<p>Copyright 2017 @ Domain - All Rights Reserved </p>
</div>
</footer>
回答by Mohsin Sharif Qureshi
Following code is work for FREE THEMES specifically.
以下代码专门用于免费主题。
.site-footer .footer-top {
background: #eee ;
}
If you want to change the background color of footer text area as well, you can add following code with the first one ine the customize>Additionial CSS are:
如果您还想更改页脚文本区域的背景颜色,您可以在自定义>附加 CSS 中的第一个添加以下代码:
.site-footer .footer-bottom {
border-top: 1px solid #eee;
background: #eee ;
}
Hope this will work for everyone, specially those who are using any free wordpress theme.
希望这对每个人都有效,特别是那些使用任何免费 wordpress 主题的人。
回答by Sagar Dalvi
footer {
background-color: #40e0d0;
text-align: justify;
}
aside {
background-color: ;
text-align: justify;
}
Above script is perfect working on my blogger site on "Add custom CSS editing theme code" https://www.seemainfoelibrary.com/search/label/Business%20Law
上面的脚本非常适合我的博客站点“添加自定义 CSS 编辑主题代码” https://www.seemainfoelibrary.com/search/label/Business%20Law
Thank you ever much I was searching such type of script.
非常感谢我一直在搜索这种类型的脚本。