2011-07-18 15 views

回答

3

CSS:

table.registration div { 
    color: red !important; 
} 

HTML:

<table class="registration"> 
<tr> 
    <td><div>This text will be red</div></td> 
</tr> 
</table> 
+0

是什么!重要的是什么意思? – user784637

+0

由于OP明确提到了'td'内的'div',因此可能考虑在CSS中的'.registration'和'div'之间添加'td'。 – rockerest

+0

基本上使得特别设置“粘性”,使得它不能被稍后的样式设置覆盖,除非后面的设置本身被标记为重要的。 –

1
.registration td div {color:red /* #ff0000 */} 
2
#registration td div { color:red; } 

table.registration td div { color:red; } 
相关问题