2013-12-10 34 views

回答

1

你沒有。 Styletarget是不同的屬性。

你可以,但是,用jQuery做到這一點很容易:

$('a.disney').attr('target', '_blank'); 
5

你可以試試:

.disney[target="_blank"] { 
    color: red; 
} 

小提琴:http://jsfiddle.net/4dW2p/

+1

這很好。我可能誤解了這個措辭不佳的問題。 – isherwood

+0

沒有必要判斷我認爲的其他語言技能。它並不是說它需要在CSS中進行定位。然而,如果你有風格選擇器a [target =「_ blank」,那麼這也不起作用。如何覆蓋? – mjgirl

+0

它的工作原理 - 例如:http://jsfiddle.net/4dW2p/1/ 如果您有問題,您可以嘗試在例子'color:red!important'中添加'!important'。 – Krzysztof

0

下選擇應該這樣做:

a.disney[target="_blank"] { 
    /* your styles here */ 
} 

支持現在基本上是普遍的 - 所有主流瀏覽器都支持它很長一段時間。見the MDN documentation