What is the correct HTML tag for adding a background color?

Options
- < body background=”yellow”>
- < background>yellow< backgound>
- .< body style=”background-color:white;”>
- None of these


CORRECT ANSWER : .< body style=”background-color:white;”>

Discussion Board
how to change back grond

how do i change back grond color

brent nimrick 09-16-2020 10:50 AM

HTML5 Purpose

HTML5 is built on the idea of separating presentation and style
Whilst
< body style=”background-color:white;”>

Is supported, it is NOT the correct approach to take
for instance: is supported by many browsers but its not part of HTML5

The correct answer should of been
A style tag used with a background property and value set within the body selector and written within the head of the document








Adam 01-10-2018 09:07 PM

Explanation-

Correct answer is none of these.

-The bgcolor attribute is not supported in HTML5. Background attribute specifies background image for document but it is not supported in HTML5.
-In simple HTML, The background-color property defines the background color for an HTML element.
e.g.
<body style="background-color:powderblue;">

Sapna 02-27-2017 11:18 PM

"background-color: yellow"

Answer is - None of these


Background-color set as yellow



Sandhya Singh 02-13-2017 03:30 AM

backgrund

Then answer is : None of the above

Raja 01-11-2017 10:32 AM

background color- Question

Answer is : background-color. refer below
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_colorhex


Srini 07-19-2015 02:34 PM

background

The background attribute is not supported in HTML5.

Methodos 05-6-2015 05:19 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement