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

Modern HTML uses CSS for styling. The correct inline CSS approach is style="background-color:yellow" (option C). The background attribute in option B is deprecated HTML4 syntax.