What possible errors make the background-color not visible after applying it on your stylesheet? | Sololearn: Learn to code for FREE!
0

What possible errors make the background-color not visible after applying it on your stylesheet?

There are times when the bgcolor works perfectly fine, but when you use a tag with a class and id, it doesn't seem to work?

10th Apr 2017, 11:54 PM
Keith Matugas
Keith Matugas - avatar
2 Answers
+ 6
With an Html5 doctype, browsers should ignore 'bgcolor' attribute, as this is a deprecated attribute in Html5... but Html is permissive ( purpose is to display page content as well possible ) and so browsers try to correct malformed / syntax errors code, and probably in your case take it in account since you didn't apply any css style, and ignore it else... or something like ^^ Anyway: you should avoid use of 'bgcolor' html attribute and prefer use 'background-color' css one, as you cannot predict the behavior of first :P
11th Apr 2017, 1:54 AM
visph
visph - avatar
+ 2
can you give an example with a code please?
11th Apr 2017, 12:45 AM
theBlueGHOST
theBlueGHOST - avatar