Henry Akinwande
8 years ago

What is the correct HTML for adding a background color?

A. <body style = “background-color : yellow” >

B. <body background= “yellow” >

C. < background >yellow< /background >

D. All of the above

Answer: Option A

Solution (By Examveda Team)

The correct HTML for adding a background color uses the style attribute within the tag.

Option A: <body style = “background-color : yellow” > - This is the correct answer. The style attribute allows inline CSS to set the background color.

Option B: <body background= “yellow” > - This is incorrect. The background attribute is deprecated and not used to set a background color.

Option C: <background >yellow< /background > - This is incorrect. The tag does not exist in HTML.

Option D: All of the above - This is incorrect because only Option A is the correct way to add a background color in HTML.

This Question Belongs to User Ask Question >> Miscellaneous

Join The Discussion

Related User Ask Questions