2011-07-18 14 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; } 
相關問題