精通css——background属性

一:概念

1. background-color(1):规定要使用的背景的颜色

2. background-position(1):规定背景图片的位置

  top left

  top center

  top right

  center left

  center center

  center right

  bottom left

  bottom center

  bottom right

  ------------------

  x% y%

  ------------------

  xpos ypos

3. background-size(3):规定背景图片的尺寸

  length

  ------------------

  percentage

  ------------------

  cover

  ------------------

  contain

4. background-repeat(1):规定如何重复背景图片

  repeat

  repeat-x

  repeat-y

  no-repeat

  inherit

5. background-origin(3):规定背景图片的定位区域

  *padding-box

  border-box

  content-box

6. background-clip(3):规定背景的绘制区域

  *border-box

  padding-box

  content-box

7. background-attachment(1):规定背景是否固定或者随着页面的其他部分滚动

  *scroll

  fixed

  inherit

8. background-image(1):规定要使用的背景图片

二:使用

猜你喜欢

转载自www.cnblogs.com/happylich/p/9926457.html