how to set color for h1 in html code example

Example 1: how to change h1 color in html

<h1 style="color: red;">
  This is a Level1 Heading
</h1>

Example 2: html background color

<html>
 
<body style="background-color:red;">
  <p> test <p/> 
  <body/>
  </html>

Example 3: how to change font color of h2 tag in html

<!doctype html>
<html>
  <head>
    <title>shivam the new hacker</title>
    <style>
      h2{font color="yellow"}
    </style>
  </head>
  <body>
    abc
  </body>
  <html>

Example 4: add color to hr tag

border: 1px solid red;

Tags:

Html Example