CSS设计彻底研究5.2节笔记

1.背景图像

(1)设置背景图像:background-image : none | url ( url )

(2)图像平铺方向:background-repeat : repeat | no-repeat | repeat-x | repeat-y

(3)图像对齐方式:background-position : (center | top | bottom | length) | (center | left | right | length)(可以设置为一个或两个属性值,分别用于水平位置和竖直位置。)

【应用】制作渐变色背景

1)准备一张垂直渐变的背景图像;

2)将背景颜色设置为背景图像最下面一排像素的颜色。

代码如下:

body{

background-image:url(bg_grad.gif);

background-repeat:repeat-x;

background-color:#39F;

}

或简写为:

body{

background:#39F url(bg_grad.gif) repeat-x;

}

相关文章:

  • 2021-10-15
  • 2021-06-22
  • 2021-11-22
  • 2021-05-23
  • 2021-10-20
  • 2021-10-09
  • 2022-03-10
  • 2021-06-13
猜你喜欢
  • 2021-08-17
  • 2021-10-25
  • 2022-03-04
  • 2021-08-29
  • 2022-01-25
  • 2021-06-11
  • 2022-01-13
相关资源
相似解决方案