Multiple choice technology web technology

What is the correct HTML for adding a background color?

  1. <body background="yellow">

  2. <background>yellow</background>

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

  4. <body color="background-color:yellow">

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

Modern HTML uses inline CSS with the style attribute to add background color: . Option A uses the obsolete 'background' attribute, which is deprecated. Option B uses a non-existent tag, and Option D has incorrect attribute syntax ('color' with a colon-separated value isn't valid HTML).