CSS Background


          background-color – this property specifies the background color of the element.


          background-image – this property specifies an image to use as background of an element. When used, the image is repeated by default to cover an entire element.

Note: Make sure that when you use a background image, use the right combination of text so that it will still be readable by the user.


          background-repeat – By default, the background-image property will repeat a background image to fill up the space allotted to the element. To prevent or control how the image will be repeated, background-repeat property is used. The background-repeat values are shown in the table below:

          background-position – this property specifies the position of the background image. By default, an image is positioned at the top left corner of the page. You can change this position using the possible values such as left center, left bottom, right center, right top, right bottom, center center, center top and center bottom.


          background-attachment – this property specifies the background image if it should be scrolled or fixed.

          The values for this property could either be scroll or fixed. It would take too much time if all of these background properties will be done one by one. CSS provides a shorthand notation in specifying the background. The shorthand property will follow an order of property values. The order would be color, image, repeat, attachment and lastly, position.




You have completed 94% of the lesson
94%