如何定義適用於此鏈接的CSS樣式class="disney"
和target="_blank"
?target = _blank按類別分類的CSS樣式
<a class="disney" href="http://www.disney.com" target="_blank">disney.com</a>
如何定義適用於此鏈接的CSS樣式class="disney"
和target="_blank"
?target = _blank按類別分類的CSS樣式
<a class="disney" href="http://www.disney.com" target="_blank">disney.com</a>
你沒有。 Style
和target
是不同的屬性。
你可以,但是,用jQuery做到這一點很容易:
$('a.disney').attr('target', '_blank');
下選擇應該這樣做:
a.disney[target="_blank"] {
/* your styles here */
}
支持現在基本上是普遍的 - 所有主流瀏覽器都支持它很長一段時間。見the MDN documentation。
http://jsfiddle.net/gMEM7/ – Anon