2013-02-08 57 views
2

我喜歡Erudite Wordpress主題。不過,我不想爲特定類型的img(即橫幅)設置邊框。我仍然需要媒體庫中的其他圖像的邊框。如何在Wordpress主題中僅移除橫幅的img橫幅?

如何編輯style.css以僅爲橫幅移除邊框?

例如,在此頁here

的形象是:

<img class="noborder" src="http://www.clomputing.com/wp-content/uploads/2013/02/available-on-appstore.png" width="280" height="80" /> 

我試圖在的style.css如下:

img.noborder { border:none; } 

但邊界仍然存在。

完整的style.css是:

.aligncenter { 
    display: block; 
    margin-left: auto; 
    margin-right: auto; 
} 

.alignleft { 
    float: left; 
} 

.alignright { 
    float: right; 
} 

img.noborder { border:none; } 
+0

試試這個img.noborder {border:none; }並且您沒有爲img標記添加類。 – Gopikrishna

+0

我回顧了你的樣式表,img.noborder似乎沒有包含在內。 – Dan

+0

@Dan我通過'Appearance'>'Editor'標籤編輯樣式表。我怎樣才能讓Wordpress包括我編輯過的style.css? – ohho

回答

1

對於未知的原因,style.css不包括在內。我必須ftp進入網站並直接編輯0​​:

.entry-content img.no-border {border:0 none; padding:0; margin:0;} 
0

邊框是給父母的div所以,即使你給邊界:無;屬性添加到您的img標籤中,不會工作。您應該從類入口內容(即父級div)中刪除邊框,並將邊框添加到您想要邊框的圖像上。

+0

不幸的是,這不是這種情況@ fahad.kazi - 請參閱以下屏幕截圖:http://postimage.org/image/e8sbpruhl/full/ – Dan

+0

我應該向你解釋.entry-content img被賦予邊界,並且會在該div中設置每個img的樣式,其稱爲css特異性。 –

+0

另外我發現.entry-content a是提供者border-bottom。 –

2

在樣式使用important試試這個CSS:

.noborder { 
    border: medium none !important; 
}