In CSS, state: link refers to the default state of an anchor (<a>) element that has not yet been visited by the user. It is defined using the :link pseudo-class.
Here's how it works:
- Default Appearance: The styles applied to links in their unvisited state can be customized using the
a:linkselector. For example, you can set the color, text decoration, background color, and other properties.
Example:
a:link {
color: blue; /* Default link color */
text-decoration: none; /* No underline */
font-weight: bold; /* Bold text */
padding: 5px; /* Padding around the link */
background-color: #f0f0f0; /* Background color */
border-radius: 3px; /* Rounded corners */
transition: all 0.3s ease; /* Smooth transition for state changes */
}
In this example, any unvisited link will appear blue, bold, and have a light gray background with rounded corners. The transition property allows for smooth changes when the link state changes (e.g., when hovered or clicked).
