top of page

Changing Font Color & Background

Since Mars is a Red Planet, I want to change the background of the Heading to Red. And I want the font color to be white.

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram

Step 1 - Adding an ID (you can add class instead of ID) to H1

<h1 ID="Firstheading">Mars Calling. Get Your Tickets Now!</h1>

The ID is Firstheading

Let's create CSS style instruction inside the header -

<head>

<style>

img.hero {

width:100%; height:auto

}

 

#Firstheading {

background-color: crimson;

color: white;

}

</style>

</head>

Notice that  in case of ID, we are using # to identify it. In case of Class we are using dot.

There is a difference between ID and Class - https://www.w3schools.com/html/html_id.asp

Screenshot_2021-10-10_22-55-19.png
bottom of page