0
I NEED A CODE TO CHANGE BACKGROUND COLOR
optional::can I have two background colors at a time
9 Antworten
+ 3
In CSS you can use it:
body {
background-color: green;
}
+ 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
for changing background color <body bgcolor= red> instead of red try any other colors
+ 1
You can have 2 background at a time
but You must use it in different tag
if same tag it will set to last code background ummm...I'm not good at english sorry
code :
HTML use tag
<anyTagElse bgColor = #RRGGBB>
JS Use inside tag script and in html tag
<script>document.(element of tag).style.backgroundColor = "#RRGGBB";</script>
CSS I havent learned yet but
I see something
use
<anyTagElse style = "background-color:#RRGGBB">
in side html tag
+ 1
ok
+ 1
You can use this in css
/*
change the background of the body
to light gray
*/
body
{
background-color:#eee;
}
......…........………………
😀😀😀😀😀😀😀
+ 1
the attribute background-color: ; can be used in any tags to change the bgcolor for particular section..<body background-color: ;> will change entire background of the page .
+ 1
what tag are you trying to change background?
0
<body bgcolor="green">