<div style="background-color: green"> or <div bgcolor="green">? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

<div style="background-color: green"> or <div bgcolor="green">?

I donˋt fully grasp the difference between background-color and bgcolor. When to use what?

9th Feb 2020, 6:49 PM
Julia Orth
Julia Orth - avatar
2 Answers
+ 4
bgcolor is the old mode to make background color for divs and modern browsers doesn’t have support for it anymore. background-color is the new css way of setting a background color. You should use background-color.
9th Feb 2020, 7:10 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 1
Thanks!
9th Feb 2020, 7:13 PM
Julia Orth
Julia Orth - avatar