+ 1

how to change the color of HTML background?

10th Oct 2016, 12:29 PM
Faheem Bozdar
10 Answers
+ 3
Yeah don't use bgcolor, ever! Use CSS instead. Arav's answer works, but the clean way to do it is like this: <html> <head> <style> body{ background-color: rgb(255,0,0); } </style> </head> <body> </body> </html> Your background will now be red.
10th Oct 2016, 3:47 PM
Schindlabua
Schindlabua - avatar
+ 2
inside the body put, for example, body{ background-color: rgb(255,255,0); }
10th Oct 2016, 5:48 PM
Jose Luis Ramirez
Jose Luis Ramirez - avatar
+ 1
You can also do <body bgcolor="red"> </body>
10th Oct 2016, 2:03 PM
Nantha kumar .R
Nantha kumar .R - avatar
+ 1
<body bgcolor="name of the color you want"> text <\body>
12th Oct 2016, 2:58 PM
Matija Stevanovic
Matija Stevanovic - avatar
+ 1
the best way is to put this code in your CSS file body { background-color: #ffffff; } you can put your favorite color in the value instead of (#ffffff)
16th Oct 2016, 7:51 PM
Rateb Özil
Rateb Özil - avatar
0
You can use inline css: <body style="background-color: rgb(put, color, here);" Content </body>
10th Oct 2016, 1:33 PM
Arav Adhikari
0
cant we use bg colour outside the body tag
10th Oct 2016, 3:04 PM
Manisha Patil
Manisha Patil - avatar
0
You can put CSS inside of style tags inside of the head like in Schindlabua's answer, or you can use inline CSS like this: <body style="background-color:purple;"> You can also add more CSS after the semi-colon if you want to change the body even more. ;) Hope this helped!
14th Oct 2016, 3:38 PM
Delaina Hardwick
Delaina Hardwick - avatar
0
no
6th Jun 2019, 1:50 PM
Ben A Meyer
Ben A Meyer - avatar
0
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
6th Jun 2019, 1:53 PM
Ben A Meyer
Ben A Meyer - avatar