-4

I need to give color to <a>. My code is:

<p id="first">
    Hypertext Markup Language (HTML) is the standard markup language for creating web pages and web applications.
    <a href="https://www.w3schools.com/html">Click here</a> to learn more about it.
</p>

I need to apply a color to each anchor using CSS.

Tim M.
  • 53,671
  • 14
  • 120
  • 163
  • 4
    Your post doesn't make any sense! – Angel Politis Jun 30 '18 at 18:59
  • Welcome! Stack Overflow is definitely a good place to get help with code but first, you must learn [how to ask questions](https://stackoverflow.com/help/how-to-ask) to get an answer to a problem you may face. – Jake Jun 30 '18 at 19:19

2 Answers2

0

If I correctly understood your message, this code works:

p a {
   color: red;
}
-1

If I think what you are asking is right (you are trying to color the links on your website) then you add this CSS to your website:

a {
    color: green;
}

As seen above, this code will change your link text into green color. If you are more into experimenting you can add some more CSS lines and change the color of the link based on how you react with it.

a:link {
    color: red;
}
a:visited {
    color: green;
}

The first part will make your link red, but after you clicked on it it will change to green.

a:hover {
    color: pink;
}

This code will change your link color to pink when you hover with your mouse over it.

Haris
  • 545
  • 3
  • 21