グローバルリンクスタイルを上書きしたいdivがあります。私は2つのリンクスタイルを持っています。一つはグローバル、一つは固有です。動作しないようですがhtml div内のリンクスタイルを無効にする
<div id="macrosectiontext"><a href="www.google.it">bla bla bla</a></div>
:ここでは、コード:
A:link {text-decoration: none; color: #FF0000;}
A:visited {text-decoration: none; color: #FF0000;}
A:hover {text-decoration: none; color: #FF0000;}
A:active {text-decoration: none; color: #FF0000;}
#macrosectiontext
{
position:relative;
font:Arial, sans-serif;
text-align:center;
font-size:50px;
font-style: bold;
margin-top:245px;
opacity: 0.6;
background-color:transparent;
}
#macrosectiontext A:link {text-decoration: none; color: #000000;}
#macrosectiontext A:visited {text-decoration: none; color: #FFFFFF;}
#macrosectiontext A:hover {text-decoration: none; color: #FFFFFF;}
#macrosectiontext A:active {text-decoration: none; color: #FFFFFF;}
と私はこのようなdiv要素を使用しています。 divは引き続きグローバルリンクスタイルを継承します。私は小文字の「Aを使用
".macrosectiontext" クラスを使用するリンクコードのために:私は "リンク... #macrosectiontext" IDを使用していないだろうCSSで
(はちょうどデモため、ホバー色を変更)あなたのHTMLにアンカーリンクが表示されていません。 –
'#macrosectiontext {color:#000000};と書いてください。これは動作します –
私にとってうまく動作します。ここには[jsfiddle](http://jsfiddle.net/Xz8KQ/)があります。 –