English

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

Advertisements
Advertisements

Question

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

Code Writing
Short Answer
Advertisements

Solution

To set the background colour for every h1 element, we build a rule for the <h1> tag and use the background-color feature.

For example, we define the rule as follows to make all <H1> elements’ backgrounds blue:

h1 { background-color : blue ; }
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Cascading Style Sheets (CSS) - Assignment [Page 275]

APPEARS IN

Sumita Arora Computer Applications [English] Class 10
Chapter 6 Cascading Style Sheets (CSS)
Assignment | Q 1. | Page 275
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×