Web browsers like Google Chrome, Microsoft Edge, Mozilla Firefox etc., automatically set some default colors to HTML links when they are displayed on the web screen if no exclusive CSS is defined for them.
Default colors for HTML links are as follows:
CSS can change the default color of a link.
Let's take an example where we will set the color of an unvisited link to magenta.
Using CSS we can remove the default style of underlining from the anchor text.
The text between the opening <a> and closing </a> tag is called anchor text.
Here to remove the underline from an unvisited link we have set the value of the
property to in the attribute.We can change the background color of a link by using the <a>.
attribute on link elementWe need to define the color in the
property.Let's take an example where we will use internal CSS to change the color of an unvisited link to Brown, a visited link to orange and an active link to violet.
The link will not have an underline for both unvisited and visited links, but we will style an active link as underlined.
We also want to style the link for mouse over (hover), i.e. when the mouse pointer comes over the link, the link text should turn green and underlined.
With CSS styling, we can turn a link created using HTML element <a> to look like a button.
1. HTML Tutorial |
2. Introduction to HTML |
3. Basic HTML Page |
4. HTML Editors |
5. Web Browser |
6. HTML History |
7. Basic HTML Tags |
8. HTML Elements |
9. HTML Attributes |
10. HTML Headings |
11. HTML Paragraphs |
12. HTML Text Formatting |
13. HTML Styles |
14. HTML Comment |
15. HTML Quotation |
16. HTML Colors |
17. HTML RGB Colors |
18. HTML HEX Colors |
19. HTML HSL Color |
20. HTML CSS |
21. HTML Links |
22. HTML Link Colors |
23. Link within Page |
24. HTML Images |
25. HTML Background Image |
26. HTML Image Map |
27. HTML Picture Element |
28. HTML Favicon |
29. HTML Table |
30. HTML Table Border |
31. HTML Table Size |