CBSE Class 10 Computer Applications Question 1 of 37

Cascading Style Sheets (CSS) — Question 1

Back to all questions
1
Question

Question 1

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

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 ; }