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.

    HTML CSS

    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
    HTML CSS

    Rules for Styling Links in State

    Some rules need to be followed when styling links in their state. These rules are mentioned below

    1. a:hover ALWAYS come after a:link and a:visited
    2. 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.

    HTML CSS

    Background Color

    To set the background of a link to a specific colour, this CSS background property can be used.

    HTML CSS

    Link Buttons

    This is generated by combining several CSS properties. It increases user interactivity with links by displaying them as clickable buttons or boxes.

    HTML CSS
  • HTML
    CSS
    JS
  • Ad #1
    Ad #2
    Scroll to Top