Multiple choice technology web 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. <color = "yellow">

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

CSS is the correct way to style HTML elements including background colors. Option C uses inline CSS with the style attribute and background-color property, which is valid. Options A and D use non-existent tags. Option B uses the deprecated HTML attribute approach that should be replaced with CSS.