As per the HTML5 standards, using the bgcolor
attribute is deprecated. So, if we’re following the current standards, we don’t use the bgcolor
attribute.
https://www.w3.org/TR/2010/WD-html-markup-20100304/body.html#body-constraints
The official W3C documentation says, “The bgcolor attribute on the body element is obsolete. Use CSS instead.”
The bgcolor
attribute was the standard way of adding background color to body
before HTML5. However, as of now, one must use CSS, i.e. using either a <link rel="stylesheet">
element, or a <style>
tag, or even the style
attribute.
Therefore, the alternative is to use <body style="background-color: black;">
or to specify the following in your stylesheet (inline or external):
body{
background-color: black;
}
solved Link tag not working while linking a css file [closed]