
CSS
CSS Links
All HTML links can be styled with CSS (Cascading Style Sheets) properties. They are styled to make the webpage visually appealing. For styling, CSS properties like CSS colour, CSS font, background, etc. are used.
CSS Links’ State and Styling
How the link will be styled also depends on its state. The link can be in one of the following How the link will be styled also depends on its state. The following are the states of a link:
- a:link – a normal link that is not visited
- a:visited – a link that is visited by a user
- a:hover – a link that the user mouses over
- a:active – a link that the user has clicked
Rules for Styling Links in State
Some rules need to be followed when styling links in their state. These rules are mentioned below
- a:hover ALWAYS come after a:link and a:visited
- a:hover MUST come before a:active
Text Decoration
All links are underlined by default in HTML. So, this CSS property is used to remove them from the link.
Background Color
To set the background of a link to a specific colour, this CSS background property can be used.
Link Buttons
This is generated by combining several CSS properties. It increases user interactivity with links by displaying them as clickable buttons or boxes.