Multiple choice technology

What is the correct HTML for adding a background color?

  1. <background>yellow</background>

  2. <body background="yellow">

  3. <body style="background-color:yellow">

  4. <body style="background-color='yellow'">

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

The correct way to add background color in modern HTML is using CSS with the style attribute: . The tag doesn't exist, and the background attribute is deprecated. Double quotes are standard in HTML attributes.