+ 4
why bgcolor attribute not work with div tag in html
I created a table in HTML. In code I write <div bgcolor="blue"> .... </div> But this code not run Why please give me reply
5 Antworten
+ 3
BaselAl hajeri is style attribute from css??
+ 2
bgcolor attribute doesn't work with every elements
Try with css
<div style="width: 100px; height: auto; background-color: blue;"></div>
+ 2
Because {Background-color}(correct)
Bgcolor (wrong)
+ 1
Use pure CSS for better result. Because all elements doesn't support bgcolor
+ 1
Since, bgcolor attribute get deprecated by css. So, you must either use bgcolor attribute in table tag rather than div tag or define background-color attribute to the div tag.