2016-08-08 6 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にする方法はありますか? 特定のクラスを除いて、すべてのthタグを対象にしたいと思います。あなたが使用することができます特定のクラス以外のすべてを対象にする

答えて

2

:notを使用しては確かに一つの代替ですが、古典的なCSSのアプローチは、特定の、その後、2つのルールを書く一般的な最初のことです。

th  { font-weight: bold; } 
th.normal { font-weight: normal; } 
関連する問題