2016-08-08 37 views
1
<head> 
<style> 
table, th, td { 
border: 1px solid black; 
border-collapse: collapse; 
} 
th { 
font-family: arial; 
font-weight: normal; 
} 
</style> 
</head> 
<body> 
<table width="200" height="300"> 
<tr style="font-weight: bold"> 
    <th>Year</th> 
    <th>Balance</th> 
    <th>Interest</th> 
</tr> 
</table> 
</body> 

有沒有一種方法可以讓CSS定位一切除了某個類? 我希望它的目標是除了某個類以外的每一個標籤。針對除特定類別以外的所有內容

回答

2

使用:not當然是一個替代方案是,但經典的CSS的方法是寫兩個規則,一般先,然後是具體。

th  { font-weight: bold; } 
th.normal { font-weight: normal; } 
相關問題