Body refers to the HTML body
that holds all the elements we design in the webpage. CSS designs the body
element with the help of following properties:
Property | Value | Description |
---|---|---|
background-color | Red; / #ff0000; / rgb(255,0,0); | Colors the background |
background-image | url("paper.gif"); | Puts a background image |
background-repeat | repeat-x; | Repeats the image horizontally |
repeat-y; | Repeats the image Vertically | |
repeat-xy; | Repeats the image entirely | |
no-repeat; | Does not repeat the image | |
background-attachment | fixed; | Background does not scroll |
scroll; | Background scrolls | |
background-position | top; / left; / bottom; / right; | Position of the background image |
body
{
background-color:#ff00ff;
}
body
{
background-image:url('scene.jpg');
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
}
body
{
background-image:url('toy.jpg');
background-repeat:repeat-x;
}
body
{
background-image:url('toy.jpg');
background-repeat:repeat-y;
}
body
{
background-image:url('toy.jpg');
background-repeat:repeat-xy;
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
background-position:top;
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
background-position:right;
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
background-position:bottom;
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
background-position:left;
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
background-attachment:fixed;
}
body
{
background-image:url('toy.jpg');
background-repeat:no-repeat;
background-attachment:scroll;
}