CSS中的优先级问题?

2025-02-27 08:27:52
推荐回答(4个)
回答1:

body {
font-family: Arial, Helvetica, Verdana, Sans-serif;
font-size: 12px;
color: #666666;
background: #ffffff;
}#content {
margin-right: 280px;
background: green;
}你的content是在body标签里面的,如果content里面没有定义background-color属性的话,他是可以继承body的background-color属性的,但如果你定义了的话,content的background-color属性就会覆盖掉body的

回答2:

#content {
margin-right: 280px;
background: green;color:#666;
}.....

回答3:

styleidclassbody用style控制

回答4:

请发完整的css代码,这段代码看不出什么