0% found this document useful (0 votes)
2 views

Css Background

The document outlines various CSS background properties including background-color, background-image, background-repeat, background-attachment, and background-position. It provides examples of how to apply these properties to the body element, including the use of shorthand notation to combine multiple properties into one. The document emphasizes the ability to control the appearance and behavior of background images in web design.

Uploaded by

Sakshi
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Css Background

The document outlines various CSS background properties including background-color, background-image, background-repeat, background-attachment, and background-position. It provides examples of how to apply these properties to the body element, including the use of shorthand notation to combine multiple properties into one. The document emphasizes the ability to control the appearance and behavior of background images in web design.

Uploaded by

Sakshi
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

CSS background properties:

background-color
background-image
background-repeat
background-attachment (The background-attachment property specifies whether the
background image should scroll or be fixed)
background-position

body {
background-color: lightblue;
}

body {
background-image: url("paper.gif");
}
body {
background-image: url("gradient_bg.png");
background-repeat: repeat-x; /repeat-y;
}
body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed; /scroll;
}

CSS background - Shorthand property


To shorten the code, it is also possible to specify all the background properties
in one single property. This is called a shorthand property.

body {
background: #ffffff url("img_tree.png") no-repeat right top;
}

You might also like