+ 1
how to change the color of HTML background?
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.
+ 2
inside the body put, for example,
body{
background-color: rgb(255,255,0);
}
+ 1
You can also do
<body bgcolor="red">
</body>
+ 1
<body bgcolor="name of the color you want"> text <\body>
+ 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)
0
You can use inline css:
<body style="background-color: rgb(put, color, here);"
Content
</body>
0
cant we use bg colour outside the body tag
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!
0
no
0
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................