+ 1
How can i change the background color of my site?
How can i change the background color of my site? fire
16 Answers
+ 7
<body bgcolor="#ff0000">
in html
+ 7
#ff0000 red
#00ff00 green
#0000ff blue
+ 7
document.getElementsByTagName("body")[0].bgcolor = "red";
compressed JS
+ 6
body {
background-color: red;
}
in css
+ 6
Really? doesn't this throw error?
+ 4
document.body.style.background = "red";
most compressed js ;) ^^
+ 3
var x = document.getElementsByTagName ("body");
x [0].style.backgroundColor = "red";
in js
+ 3
$("body").css("background-color", "red");
in jQuery
+ 3
actually you don't even need that [0], so it will be even more compressed ^^
+ 3
this should change all body elements then but normally there is only one so you don't need that
+ 2
you can use background-color property of css
+ 2
<body bgcolor=" green"> or another color name or hex color #00800 , # c7c7c7 ......
if you have a picture you can use it as a background
<body background="image path " >
or use CSS as well
body {
background-color: ads here the color you want ;
}
+ 1
using style we can able change the background color...
+ 1
<html>
<body style="background-color:white;">
</body>
</html>
0
puede buscar el color adecuado en hexadecimal utilizando la herramienta de adobe, luego utilizas bgcolor. https://color.adobe.com/es/create/color-wheel/
0
<body bgcolor="red">