+ 1
what is the difference between bgcolor and background-color?
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; }.
+ 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.
+ 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.
0
<bgcolor> is the background color of the page. Bg stands for background.
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.