+ 1

what is the difference between bgcolor and background-color?

15th Jun 2016, 5:36 PM
rice l
rice l - avatar
5 Antworten
+ 7
bgcolor is an html attribute which is deprecated, meaning it's not supported in html5. Don't use it. This leads us to the second half of your question: background-color is the CSS (stylesheets) alternativ to bgcolor. Imagine you have 100 html documents and you gave them all the same background using <body bgcolor="skyblue">. One day you decided to change it to 'white'. To do that you have to edit all 100 documents! With the background color declared in a stylesheet file which is included in the <head> of all documents, you only need to edit one file. body { background-color:white; }.
16th Jun 2016, 2:12 AM
ZinC
ZinC - avatar
+ 3
The main difference is that bgcolor is an attribute used in the HTML document while background-color is a CSS property, used inside a declarations block within a CSS rule. Another difference is that bgcolor doesn't accept rgba () colors as value. There might be other differences, but the use of styling through HTML attributes is highly discouraged.
26th Jun 2016, 7:19 PM
Elena Alexie
Elena Alexie - avatar
+ 1
bgcolor is a attribute for html and background-color is a property for css. it's better that use css style for set background color for your web pages or web elements.
1st Aug 2016, 1:07 AM
Abbas Motallebi
Abbas Motallebi - avatar
0
<bgcolor> is the background color of the page. Bg stands for background.
15th Jun 2016, 8:47 PM
M G
M G - avatar
0
+2 The main difference is that bgcolor is an attribute used in the HTML document while background-color is a CSS property, used inside a declarations block within a CSS rule. Another difference is that bgcolor doesn't accept rgba () colors as value. There might be other differences, but the use of styling through HTML attributes is highly discouraged.
6th Aug 2018, 2:53 PM
Mohit Agnihotri
Mohit Agnihotri - avatar