How can i change the background color of my site? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can i change the background color of my site?

How can i change the background color of my site? fire

4th Jan 2017, 5:34 PM
FIRE EAGLE
FIRE EAGLE - avatar
16 Answers
+ 7
<body bgcolor="#ff0000"> in html
4th Jan 2017, 5:36 PM
Kamil
Kamil - avatar
+ 7
#ff0000 red #00ff00 green #0000ff blue
4th Jan 2017, 5:37 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 7
document.getElementsByTagName("body")[0].bgcolor = "red"; compressed JS
4th Jan 2017, 5:43 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 6
body { background-color: red; } in css
4th Jan 2017, 5:35 PM
Kamil
Kamil - avatar
+ 6
Really? doesn't this throw error?
4th Jan 2017, 5:45 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 4
document.body.style.background = "red"; most compressed js ;) ^^
4th Jan 2017, 5:54 PM
Kamil
Kamil - avatar
+ 3
var x = document.getElementsByTagName ("body"); x [0].style.backgroundColor = "red"; in js
4th Jan 2017, 5:38 PM
Kamil
Kamil - avatar
+ 3
$("body").css("background-color", "red"); in jQuery
4th Jan 2017, 5:40 PM
Kamil
Kamil - avatar
+ 3
actually you don't even need that [0], so it will be even more compressed ^^
4th Jan 2017, 5:44 PM
Kamil
Kamil - avatar
+ 3
this should change all body elements then but normally there is only one so you don't need that
4th Jan 2017, 5:46 PM
Kamil
Kamil - avatar
+ 2
you can use background-color property of css
4th Jan 2017, 6:40 PM
Tanmoy Sarkar
Tanmoy Sarkar - avatar
+ 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 ; }
4th Jan 2017, 8:38 PM
Abdel
Abdel - avatar
+ 1
using style we can able change the background color...
5th Jan 2017, 10:41 AM
Swathika
+ 1
<html> <body style="background-color:white;"> </body> </html>
23rd Jan 2017, 2:41 PM
kimmitts
kimmitts - avatar
0
puede buscar el color adecuado en hexadecimal utilizando la herramienta de adobe, luego utilizas bgcolor. https://color.adobe.com/es/create/color-wheel/
4th Jan 2017, 7:16 PM
Gustavo Adolfo Rodríguez Alonso
Gustavo Adolfo Rodríguez Alonso - avatar
0
<body bgcolor="red">
17th Nov 2017, 12:43 PM
Dibakar Mandal
Dibakar Mandal - avatar