Blog Desk       February 10, 2020      140

How do you add a background color for all <h1>elements?

  1. h1.all {background-color:#FFFF00;}
  2. all.h1 {background-color:#FFFF00;}
  3. h1 {background-color:#FFFF00;}

The Right Answer is : Option C

Explanation

Add background color for all HTML element of H1 or P

Change the background color of all <p> and all <h1elements use following code.

Example:

h1{background-color:#ff0000;} p{background-color:#ffff000;}