2013-07-17 110 views
0

我想刪除第一個孩子假的邊界,但我不能讓它工作。刪除邊界上:第一個孩子

這是類IM與

.main:not(.home-page) > section article h2 { 
    margin-top: 1em; 
    padding-top: 1em; 
    border-top: 1px dotted #ccc; 
} 

工作,所以我想這

.main:not(.home-page) > section article h2:first-child{ 
    border-top: 0px dotted #ccc; 
} 

,但沒有做的伎倆。任何其他想法?

+0

能否請您爲這個小提琴演示? –

+0

爲什麼這不起作用?你能告訴我們一些HTML代碼嗎? – putvande

+1

'border-top:0'已足夠 – otinanai

回答

2

請試試這個

.main:not(.home-page) > section article:first-child h2{border-top: 0px dotted #ccc;} 
1

剛確定的各顏色以transparentMDN on border-top-color):

.main:not(.home-page) > section article h2:first-child{ 
    border-top-color: transparent; 
}