Question:

What is the correct HTML for adding a background color?

Show Hint

While \texttt{bgcolor} is still supported in HTML, it is recommended to use CSS for styling in modern web development.
Updated On: Jun 16, 2025
  • <body color="yellow">

  • <body bgcolor="yellow">

  •  <background>yellow</background>

  •  <body background="yellow">

Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

In HTML, the background color of a page can be set using the bgcolor attribute within the <body> tag. It is not recommended to use inline styling for this; CSS is preferred for modern web development.

Was this answer helpful?
0
0