출처: http://www.w3schools.com/css/css_background.asp


All CSS Background Properties

PropertyDescription
backgroundSets all the background properties in one declaration
background-attachmentSets whether a background image is fixed or scrolls with the rest of the page
background-colorSets the background color of an element
background-imageSets the background image for an element
background-positionSets the starting position of a background image
background-repeatSets how a background image will be repeated


When using the shorthand property the order of the property values is:

  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

It does not matter if one of the property values is missing, as long as the ones that are present are in this order.



CSS Backgrounds 예제

Set the background color of a page
Set the background color of different elements
Set an image as the background of a page
Bad background image
How to repeat a background image only horizontally
How to position a background image
A fixed background image (this image will not scroll with the rest of the page)
All the background properties in one declaration
Advanced background example

Background properties explained

'개발관련 > CSS/CSS3' 카테고리의 다른 글

[CSS]CSS Styling - Styling Tables  (0) 2012.10.23
[CSS]CSS Styling - Styling Lists  (0) 2012.10.23
[CSS]CSS Styling - Styling Links  (0) 2012.10.23
[CSS]CSS Styling - Styling Fonts  (0) 2012.10.23
[CSS]CSS Styling - Styling Text  (0) 2012.10.23
Posted by 파노카페
: