2013-05-11 102 views
0

我已經看到關於第一個孩子的其他一些問題,但我似乎無法獲得任何工作。 我有一張桌子,並且希望第一列全部爲粗體,但其餘部分爲正常。第一個孩子的css表問題

關於表我有

div.article table{ 
    /* formatting stuff */ 
} 

div.article table th { 
    /* formatting */ 
} 

div.article table tr { 
    /* more formatting. I've got a funky looking table. */ 
} 

於是我嘗試

div.article table tr:first-child { 
    font-style:bold; 
} 

,但它似乎並沒有產生影響。

任何想法?我懷疑它確實很小,但我忽略了它。

+0

你可以顯示你的html的一部分嗎? – 2013-05-11 05:19:12

回答

4

你應該使用:

div.article table tr td:first-child { 
    font-weight: bold; 
} 

帶着它設置了當前正在指定這是tablefirst-child行應該有它font-style設置爲bold的方式。這裏有兩個問題,你應該使用font-weight而不是font-style,並且你想要定位所有td的行,它們是first-child

+1

它的字體重量,而不是字體樣式 – 2013-05-11 05:19:12

+0

哦,上帝。字體重量/風格。這是愚蠢的小東西*沉入地下* – 2013-05-11 05:23:47

+0

這不是唯一的問題,如果你想要定位第一列,你必須將其更改爲'div.article table tr td:first-child' 。 – 2013-05-11 05:25:07