簡體   English   中英

在 html 中訪問鏈接后如何刪除下划線和紫色文本顏色

[英]How can I remove underline and purple text color after the link is visited in html

我有一個帶有圖像和一些文字的盒子。 我希望整個框成為一個新頁面的鏈接。 當我使用 hover 時,我希望降低不透明度並改變背景顏色,就像我管理的那樣。 但是,當我 go 訪問鏈接后返回頁面時,文本變為紫色並帶有下划線。

我嘗試使用 a:visited 但它不起作用。

我很感激我能得到的所有幫助

 .one { margin: 10px; background-color: rgb(231, 231, 231); width: 29%; padding: 10px; display: inline-flex; text-decoration: none; color: black; }.one img { margin: 0 15px 0 0; object-position: 0% -90px; width: 230px; /* width of container */ height: 230px; /* height of container */ object-fit: cover; border-radius: 50%; }.one:visited{ text-decoration: none; color: black; }.one:hover { opacity: 90%; background-color: rgb(238, 238, 238); }
 <a href="surf.html" class="one"> <img src="surf.jpg" alt=""> <div> <h1>Surfing</h1> <p>Come and surf in the worlds most beautiful places</p> </div> </a>

你試過這個嗎:

a {color:#FF0000;}         /* Unvisited link  */
a:visited {color:#00FF00;} /* Visited link    */
a:hover {color:#FF00FF;}   /* Mouse over link */
a:active {color:#0000FF;}  /* Selected link   */

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM