Multiple choice technology web technology

How do you add a background color for all

elements?

  1. all.h1 {background-color:#FFFFFF}

  2. h1 {background-color:#FFFFFF}

  3. h1.all {background-color:#FFFFFF}

  4. h1.all {color:#FFFFFF}

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To style all elements of a type, use the element name directly as the selector without modifiers. 'h1 {background-color:#FFFFFF}' correctly targets all h1 elements. Options A and C incorrectly add '.all' which is not valid CSS syntax for targeting all elements of a type, and Option D changes the wrong property (color instead of background-color).