Home > other >  Background on body element
Background on body element

Time:06-01

How can i put background on body in css , but i dont want the header and nav menu to be on same background too. I want the background color be under the header ( my header is arounded with the color too).

CodePudding user response:

To accomplish this result, you want to give the header and nav a different color than the body.
Here is an example:

header {background-color:red;} 
nav {background-color:yellow;}
body {background-color:black;}

CodePudding user response:

So you can do this:

header{
   background-color:<color_1>
}
body{
   background-color:<color_2>
}
nav{
   background-color:<color_3>
}

you should change by color you want

  • Related