CSS Backgrounds Flashcards
CSS Background Syntax
Use a CSS property to add a background with color to a web pages background
body{
background-color: lightyellow;
}
Use a CSS property to make an image a background to a web page.
body{
background-image: url(GreenFlower.jpeg);
}
Use a CSS property to make the web pages background image repeat horizontally (x - sideways repeat)
body{
background-repeat: repeat-x;
}
Use a CSS property to make the web pages background image repeat vertically (y - upwards repeat)
body{
background-repeat: repeat-y;
}
Use a CSS property to stop the background image of a web page stop/not repeating in the background of the web page.
body{
background-repeat: no-repeat;
}
Use a CSS property to specify the position of a background image on a web page.
body{
background-position: top right;
}
Use a CSS property to decide whether a background image should be static or scroll when a user scrolls down a web page’s content.
body{
background-attachment: scroll;
}