How to Change the Color of a Link in CSS

Start out by placing your regular HTML codes, then add the link you wish to color., With CSS you have to write in the HEAD section of your site., You shouldn't end the code yet, however some website designers do end the code before it's finished and...

13 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Start out by placing your regular HTML codes

    For the sake of doing this without any errors, we'll use images from Adobe DreamWeaver.

    And we'll use google for the link.
  2. Step 2: then add the link you wish to color.

    So you should type <style type="text/css"> where it says <head>. , Links consist of 4 elements.

    Link, hover, visited, and active.

    Link is the primary color of your link, this is what color it will normally display.

    Hover is a variable to make it change color, and stand out when your mouse goes over the link.

    Visited is an after click variable, it will display this color anytime after you've clicked the link.

    Active is the click on color, it will become this color the moment your mouse clicks and release it to activate the link. , You want to make 4 elements after it, with an enter separating them. a:link , a:hover , a:visited , a:active.

    It's recommended you don't capitalize any of them. ,, Alternatively you can simply type {color:;} the the selection of colors is much more limited. ,, To do this in a CSS stylesheet, simply put /* */ .
  3. Step 3: With CSS you have to write in the HEAD section of your site.

  4. Step 4: You shouldn't end the code yet

  5. Step 5: however some website designers do end the code before it's finished and then work on the closed tag.

  6. Step 6: Add onto the CSS stylesheet.

  7. Step 7: Type the following after all of them {color:#;}

  8. Step 8: You're going to need a basic understanding of hex code to get specific with your colors.

  9. Step 9: When you have all of this done

  10. Step 10: you should add </style> to close the tag.

  11. Step 11: It is recommended

  12. Step 12: however not required

  13. Step 13: that you add comments so that it will be easier to edit your codes later on.

Detailed Guide

For the sake of doing this without any errors, we'll use images from Adobe DreamWeaver.

And we'll use google for the link.

So you should type <style type="text/css"> where it says <head>. , Links consist of 4 elements.

Link, hover, visited, and active.

Link is the primary color of your link, this is what color it will normally display.

Hover is a variable to make it change color, and stand out when your mouse goes over the link.

Visited is an after click variable, it will display this color anytime after you've clicked the link.

Active is the click on color, it will become this color the moment your mouse clicks and release it to activate the link. , You want to make 4 elements after it, with an enter separating them. a:link , a:hover , a:visited , a:active.

It's recommended you don't capitalize any of them. ,, Alternatively you can simply type {color:;} the the selection of colors is much more limited. ,, To do this in a CSS stylesheet, simply put /* */ .

About the Author

J

Joshua Vasquez

Brings years of experience writing about lifestyle and related subjects.

109 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: