我一直在這個事情上停留了一段時間,無法提出解決方案。我有幾個我使用class來設計的鏈接。但是,似乎懸停和:訪問狀態樣式僅適用於第一個鏈接,即使我專門使用了類來對所有樣式進行樣式設置。我真的不確定那裏的舉動。CSS鏈接:懸停樣式僅適用於第一個實例,即使使用類
這裏是我的代碼:
<div class="container">
<div class="row">
<div class="col-md-6 push-md-3 max-auto main animsition">
<h3 class="text-center">Contact <span class="dev">Me</span></h3>
<p class="contactLinks"><a href="mailto:#"><i class="fa fa-envelope" aria-hidden="true"></i> - Email me</a></p>
<p class="contactLinks"><a href="#" target="_blank"><i class="fa fa-facebook-official" aria-hidden="true"></i> - Facebook</a></p>
<p class="contactLinks"><a href="#" target="_blank"><i class="fa fa-twitter-square" aria-hidden="true"></i> - Twitter</a></p>
<p class="contactLinks"><a href="#" target="_blank"><i class="fa fa-linkedin-square" aria-hidden="true"></i> - LinkedIn</a></p>
</div>
</div>
</div>
CSS:
.main > h3 {
padding-bottom: 30px;
}
.contactLinks a {
font-size: 150%;
color: #262626;
}
.contactLinks a:hover {
color: #6E8A71;
text-decoration: none;
}
.contactLinks a:visited {
color: #262626;
text-decoration: none;
}
嗨,感謝您的快速響應!這解決了:懸停部分,但我仍然在點擊它們之後獲得帶下劃線的鏈接。剛纔我讀到,你實際上無法使用文本裝飾屬性:visited鏈接。是否有另一種方法來解決這個問題? – TommyVee
@TommyVee爲該問題添加了解決方法。閱讀我編輯的答案:D –
謝謝,終於搞定了! – TommyVee