[英]How can I remove underline and purple text color after the link is visited in html
[英]How can I make a link in HTML turn a color when hovering and remove the underline using CSS?
如何在HTML中使用HTML轉換顏色並使用CSS刪除下划線?
您想要查看:hover偽選擇器 , 顏色屬性和文本修飾屬性。
a:hover { color: red; text-decoration: none; }
要確保您的超鏈接按照您的方式設置樣式(並且不與其他樣式規則沖突),請使用!important
:
a:hover { color: red !important; text-decoration: none !important; }
除了stragers回答之外,請確保以LoVe HAte方式聲明偽類。 您必須聲明:首先鏈接,然后:訪問,然后:懸停然后:活動。 否則某些瀏覽器可能不會應用偽類。
a:link{ /*this only apllies to named anchors*/ } a:visited{ /*possible styles for visited links*/ } a:hover{ /*when mouse hovers over a-tag*/ text-decoration:none; color:red; } a:active{ /*possible styles on active (when a-tag is clicked)*/ }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.