About "bgcolor" attribute | Sololearn: Learn to code for FREE!

+2

About "bgcolor" attribute

We can use bgcolor attribute in <table> , <tr> , <td> , <body> tag. But why we can't use it in <div> , <span> , <h1> tag ?

3/11/2019 1:06:17 PM

Unknown Error

7 Answers

New Answer

+11

Bgcolor is not supported in html5. Use background-color instead.

+7

Use CSS Instead of this obsolete attribute

+5

You can use as inline CSS. STYLE="BACKGROUND-COLOR: blue;"

+4

Welcome UnknOwN ErroR

+2

thanks Mitali di

+2

can i use background-color as an attribute or in style attribute ?

+1

thanks Gaurav bhojwani