How to change link color in CSS ?
In HTML hyperlinks are added into the webpage by using the anchor tag <a>Name</a>. It creates the link navigate to another webpage from the current webpage.
The default HTML links are in blue color and when mouse hovered they get an underline. When the link is visited, it becomes violet. These default properties can be changed and can be customized by using different CSS properties.
Example 1: Create a basic customization of HTML link using CSS selector.
The links can be further customized based on the state.
The links basically have 4 states.
Example 2: We can give different color to the links on change of their states.
Output: The unvisited and visited links have different colors. On placing the mouse over the second link, we see the change in color and style of the link. The order for placing a: hover must be after a: link and a: visited. The style a: active should come after a: hover.
Example 3: The links can be further styled by applying different CSS properties like background-colour, font-size, font-style, text-decoration and many.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.