arsenio-little
Uploaded by
4 SLIDES
275 VUES
90LIKES

CSS Link Styling: Customizing the Anchor Element for Different States

DESCRIPTION

Learn how to style anchor elements in CSS with various properties such as font-family, color, and text-decoration. This guide covers the four link states: unvisited (a:link), visited (a:visited), hover (a:hover), and active (a:active), allowing for tailored appearances based on user interactions. An example CSS snippet demonstrates how to set distinct colors for each state. Proper sequence in defining these styles is crucial to ensure consistent behavior across different browsers. Enhance your web design by mastering CSS link styling!

1 / 4

Télécharger la présentation

CSS Link Styling: Customizing the Anchor Element for Different States

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSS Link Styling

  2. The Anchor Element: • Link text between the opening <a> and closing </a> can be styled using CSS. Some of the properties that can be set are: • font-family, font-size, font-style, font-weight • color • background-color • text-decoration

  3. Link States: • The <a> element is unusual in that it can be in one of four different conditions - or "states" - and we can define separate styles for each of these states. The four states are: • a:link = unvisited link (default state) • a:visited = previously visited link • a:hover = link being moused over • a:active = link being clicked

  4. Example of CSS Link Styling: <head> <style type="text/css"> a:link { color:red; } a:visited { color:green; } a:hover { color:blue; } a:active { color:orange; } </style> </head> After the link was clicked and we returned to this page. As we are actually clicking on the link. Note: Always list these properties and states in the order shown. Mixing their order on your style sheet can result in unpredictable results. <a href="http://www.google.com"> Link to Google </a>

More Related