How to change the color of links in HTML?

HTMLWeb DevelopmentFront End Technology

To change the color of links in HTML, use the CSS property color. Use it with the style attribute. The style attribute specifies an inline style for an element.

Use the style attribute with the CSS property color to change the link color. Just keep in mind, the usage of style attribute overrides any style set globally. It will override any style set in the HTML <style> tag or external style sheet.

Example

You can try to run the following code change the color of links in HTML

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Link Color</title>
   </head>
   <body>
      <h2>About</h2>
      <p>
         Our <a href="/about/about_team.htm" style="color: red">Team</a>
            comprises of programmers, writers, and analysts.
      </p>
   </body>
</html>
raja
Published on 01-Feb-2018 06:12:03
Advertisements