- Home
- /
- CSS Links
CSS Tutorial
Introduction
CSS Properties
CSS Designing
CSS Advance Topics
CSS FAQs
- Home
- /
- CSS Links
CSS Links
Links (<a>
tags) are an essential part of any website, used for navigation and redirection. With CSS, you can control how links appear in different states: normal, hovered, visited, and active.
Syntax
a {
/* normal link styling */
}
a:hover {
/* when user hovers over the link */
}
a:visited {
/* already clicked/visited link */
}
a:active {
/* when link is being clicked */
}
Styled Link with Hover Effect
Learn With Arshyan
Visit our Tutorials page:
Go to Tutorials
Explanation
color: blue;
– Link appears blue by default.text-decoration: none;
– Removes underline on normal state.:hover
– When the mouse hovers over the link, it turns hotpink and underlined.:visited
– Visited links turn purple.:active
– When clicked, link briefly turns red.target="_blank"
– Opens the link in a new tab.
Try It Yourself
Replace the link with any URL you like, and test how each state (hover, visited, active) behaves.