[英]Text styling in CSS
I have a footer in my HTML file: 我的HTML文件中有一个页脚:
<footer>
<p>
Copyright © 2013.
</p>
</footer>
And here is my css file: 这是我的css文件:
footer {
background: #333;
color: #FFFFFF;
font-size: 60%;
font-family: tahoma, sans-serif;
text-align: center;
margin: 0;
padding: 10px 0;
}
But why it didn't change my text style? 但是为什么它没有改变我的文字样式? What am I doing wrong?
我究竟做错了什么?
Thanks. 谢谢。
That is because you need to print this: 这是因为您需要打印以下内容:
footer {
background: #333;
}
footer p {
color: #FFFFFF;
font-size: 60%;
font-family: tahoma, sans-serif;
text-align: center;
margin: 0;
padding: 10px 0;
}
instead of this: 代替这个:
footer {
background: #333;
color: #ccc;
font-size: 70%;
font-family: tahoma, sans-serif;
text-align: center;
margin: 0;
padding: 10px 0;
}
In CSS you always need to cut your code on p
, h2
a
, span
etc. 在CSS中,您始终需要在
p
, h2
a
, span
等上剪切代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.