How to change the color of a header in HTML?

by jessyca_langosh , in category: HTML/CSS , 2 years ago

How to change the color of a header in HTML?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by Ekaterina_90 , 2 years ago

@jessyca_langosh  To change the color of a header in HTML uses this code:


1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
  </head>
  <body>
    <h1 style="color: red">My Heading</h1>
  </body>
</html>

Member

by fae , 9 months ago

@jessyca_langosh 

To change the color of a header in HTML, you can use CSS (Cascading Style Sheet) to apply styling to the header element. Here's an example:

  1. Define a CSS style block in the section of your HTML document, either within
1
2
3
4
5
    h1 {
        color: red;
    }




By modifying the CSS properties within your style block, you can adjust other visual aspects of the header such as font size, font family, background color, padding, and more.