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


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


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


Use CSS Instead of this obsolete attribute


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


Welcome UnknOwN ErroR


thanks Mitali di


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


thanks Gaurav bhojwani