Can i use the bgcolor attribute for the whole background of my webpage. And forget about calling it in the CSS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can i use the bgcolor attribute for the whole background of my webpage. And forget about calling it in the CSS

<html> <head><title></title></head> <body bgcolor="grey"> </html> </html>

1st May 2017, 9:45 PM
Joseph Ameh Junior
Joseph Ameh Junior - avatar
4 Answers
+ 4
1. go to code playground and try for yourself. I'm not sure if it still works with html5, but it worked in the earlier versions. 2. why no css? the styling should be done by css only.
1st May 2017, 9:55 PM
Mario L.
Mario L. - avatar
+ 3
you can to do it like this in html: <body style="background-color:gray;"></body> in css: body { background-color:gray; }
1st May 2017, 9:54 PM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
+ 3
@Nikola, its not what he ask and your html code also contains css, The code you written (style="background-color:gray;") is css. It is the combination of html and css.
2nd May 2017, 3:56 AM
Anmol kumar
Anmol kumar - avatar
+ 2
Yes you can use bgcolor attribute for the whole background of your webpage.
2nd May 2017, 3:49 AM
Anmol kumar
Anmol kumar - avatar