CSS allows you to style links in different ways, including changing their color, font, and background. Here are some examples of CSS link styles:
- Change link color: You can change the color of a link using the
color
property in CSS. For example:
a {
color: blue;
}
This will change the color of all links to blue.
2. Change link hover color: You can change the color of a link when the user hovers over it using the :hover
pseudo-class in CSS. For example:
a:hover {
color: red;
}
This will change the color of a link to red when the user hovers over it.
3. Remove underline from links: By default, links are underlined in most web browsers. You can remove the underline using the text-decoration
property in CSS. For example:
a {
text-decoration: none;
}
This will remove the underline from all links.
4. Add background color to links: You can add a background color to a link using the background-color
property in CSS. For example:
a {
background-color: yellow;
}
This will add a yellow background color to all links.
5. Change link font: You can change the font of a link using the font-family
property in CSS. For example:
a {
font-family: Arial, sans-serif;
}
This will change the font of all links to Arial or a sans-serif font.
These are just a few examples of how you can style links using CSS. Remember to experiment with different styles and find what works best for your website.