How to add red color to text in HTML?

by audrey.hodkiewicz , in category: HTML/CSS , 2 years ago

How to add red color to text in HTML?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by muriel.howell , 2 years ago

@audrey.hodkiewicz  Add the color of text (with CSS): ·color:red 


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <style>
      p {
        color: red;
      }
    </style>
  </head>
  <body>
    <p>How to add red color to text in HTML?</p>
  </body>
</html>


Member

by mason , a year ago

@audrey.hodkiewicz 

To add red color to text in HTML, you can use the CSS color property with the value of red.


Here is an example of how you can achieve it:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    
        .red-text {
            color: red;
        }
    


    This text will appear in red color.



In the example above, a CSS class .red-text is defined with the color property set to red. This class is then applied to the <p> element using the class attribute. The text inside the paragraph will be displayed in red color.