Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

html - Hyper link Color-styling in CSS

The hyperlink's initial colour is blue, i.e,, of the visited selector. But the background-colour is black, i.e., of the link selector. Additionally, after visiting the link once, the text colour remains blue as it should be, but the background does not transform to transparent.

(Here is the styling code:) <style> a:link { color: pink; background-color: black; text-decoration: none; } a:visited { color: blue; background-color: transparent; text-decoration: none; } a:hover { color: red; background-color: transparent; text-decoration: underline; } a:active { color: yellow; background-color: transparent; text-decoration: underline; } </style> </head> <body> <h2>Link Colors</h2> <a href="html_images.asp" target="_self">HTML Images</a> </body> </html> question from:https://stackoverflow.com/questions/66057834/hyper-link-color-styling-in-css

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Visited: A link when it has already been visited (exists in the browser's history), styled using the :visited pseudo-class.

So if you have visited your link at least once it will always be visited

You can read more about this here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...