リンクを下線なしで白で表示しようとしています。テキストの色は白で正しく表示されますが、青い下線が頑固に残っています。CSSでリンクの下線を削除しようtext-decoration: none;
としましたがtext-decoration: none !important;
、どちらも機能しませんでした。
.boxhead .otherPage {
color: #FFFFFF;
text-decoration: none;
}
<div class="boxhead">
<h2>
<span class="thisPage">Current Page</span>
<a href="myLink"><span class="otherPage">Different Page</span></a>
</h2>
</div>
リンクから青い下線を削除するにはどうすればよいですか?
ベストアンサー1
text-decoration: none;
アンカー ( .boxhead a
) ではなく、スパン要素 ( ) に適用しています.boxhead
。
これを試して:
.boxhead a {
color: #FFFFFF;
text-decoration: none;
}