body {
background-color: green;
}
html,body {
background-color: red;
}
body {
background-color: red;
}
/* Keyword values */
background-color: gainsboro;
background-color: lightcoral;
/* Hexadecimal value */
background-color: #0000ff; /* blue opaque */
background-color: #00f; /* blue opaque shorthand */
background-color: #0000ff00; /* blue transparent */
background-color: #00f0; /* blue transparent shorthand */
background-color: #0000ffff; /* blue opaque */
background-color: #00ff; /* Fully opaque shorthand */
/* RGB value */
background-color: rgb(0, 0, 255); /* blue opaque */
background-color: rgba(0, 0, 255, 0.5); /* 50% transparent */
/* HSL value */
background-color: hsl(67, 100%, 50%); /* yellow opaque */
background-color: hsla(67, 100%, 50%, 0.75); /* 75% transparent */
/* Special keyword values */
background-color: currentcolor;
background-color: transparent;
/* Global values */
background-color: inherit;
background-color: initial;
background-color: unset;
body{
background: lightblue;
}
/* To apply color to background you have to use 'background-color' property and value of property is color name. */
html,body {
background-color: blue;
}
background-color: blue;
<style>
body {
background-color: coral;
}
</style>
html {background-color: #ededed;} /*Changes the background colour to a light grey*/
body {background-color: coral;}
//javascript type css:
document.body.style.backgroundColor = "blue";
// or inline css:
<div style="background-color: blue;"></div>
background-color: green;
.class,#id,div {
background-color: green;
}
document.getElementById('id').style.backgroundColor = 'green';
body {
background-color: black;
}
background-color: /*your color*/ ;
Code Example |
---|
Css :: css break wrap header |
Css :: Horizontal Scrolling Bopostrap CSS |
Css :: Add elipses to a dom element with css |
Css :: change font size according to screen css |
Css :: smooth scroll |
Css :: overflow x not hidden |
Css :: css user-select |
Css :: li not first child |
Css :: css space between child elements |
Css :: how to hide some grid items from grid in css |
Css :: clamp css |
Css :: add shadow to background image css |
Css :: box position in center css |
Css :: css circle with number |
Css :: hide scroll bar but still be scrollable. |
Css :: mediaquery for portrate |
Css :: cursor as image css |
Css :: color code css |
Css :: creating drop shadow css |
Css :: email background image |
Css :: live sass compiler settings |
Css :: background image path |
Css :: mac input shadow |
Css :: ios safe area |
Css :: how to make a list vertical in css |
Css :: star required css |
Css :: linear gradient tailwind css |
Css :: how to add color in css |
Css :: background color using css |
Css :: transition various properties css |