KnowledgeBoat Logo
|

Computer Applications

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

CSS

3 Likes

Answer

We define a rule for <h1> tag and use the property background-color to set the background color for all h1 elements.

For example, to set the background color of all <H1> elements to blue, we define the rule as follows:

h1 { background-color : blue ; }

Answered By

2 Likes


Related Questions