我想能夠鏈接和一組文字懸停在淡出這個動作
HTML
<nav class="PageNav">
<ul>
<li id="HomeLink"><a href="http://www.example.com">Home</a></li>
<li id="OverviewLink"><a href="http://www.example.com/overview">Overview</a></li>
<li id="ServicesLink">
<a href="http://www.example.com/services">Mega Services</a>
<ul class="PageSubNav">
<li><a href="http://www.example.com/services/subpage">Subpage 1</a></li>
<li><a href="http://www.example.com/services/subpage">Subpage 2</a></li>
<li><a href="http://www.example.com/services/subpage">Subpage 3</a></li>
<li><a href="http://www.example.com/services/subpage">Subpage 4</a></li>
<li><a href="http://www.example.com/services/subpage">Subpage 5</a></li>
<li><a href="http://www.example.com/services/subpage">Subpage 6</a></li>
</ul>
</li>
<li id="GalleryLink"><a href="http://www.example.com/gallery">Gallery</a></li>
<li id="VideoLink"><a href="http://www.example.com/video">Video</a></li>
<li id="ContactLink"><a href="http://www.example.com/contact">Contact</a></li>
</ul>
</nav>
<article class="ContentText">
<p>text</p>
<p>dummy text</p>
<p>Dummy text, dummy text, dummy text, dummy text, <strong>3 Paragraphs, Roughly 209 Words</strong></p>
</article>
CSS
#ServicesLink:hover .ContentText p {
color: rgba(255,255,255,0.5);
}
我在想這個問題時遇到了麻煩,這裏是我的,但無濟於事。
這個想法是,當人們將鼠標懸停在「大型服務」選項卡上時,文章部分中包含的文本就會消失。
試過CSS樣式'不透明度? –
對不起,我應該提到它不是CSS風格本身我認爲它的「#ServicesLink:懸停.ContentText p {}」部分是錯誤的...當我使用樣式'.ContentText p {color:rgba( 255,255,255,0.5);}'它按預期工作。現在我只需要在標籤懸停時生效 – user3012749
我不認爲你可以用CSS來做到這一點。你需要一些JavaScript。 –