CSS中 .nav{background:url(img/bgli_left.gif) repeat-x scroll left bottom;}重点解释scroll重点解释scroll.X轴左下角平铺

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/02 14:06:39
CSS中 .nav{background:url(img/bgli_left.gif) repeat-x scroll left bottom;}重点解释scroll重点解释scroll.X轴左下角平铺

CSS中 .nav{background:url(img/bgli_left.gif) repeat-x scroll left bottom;}重点解释scroll重点解释scroll.X轴左下角平铺
CSS中 .nav{background:url(img/bgli_left.gif) repeat-x scroll left bottom;}重点解释scroll
重点解释scroll.X轴左下角平铺

CSS中 .nav{background:url(img/bgli_left.gif) repeat-x scroll left bottom;}重点解释scroll重点解释scroll.X轴左下角平铺
background-attachment:{fixed|scroll} 背景图像是否固定或者随着页面的其余部分滚动
  scroll 默认.背景图像会随着页面其余部分的滚动而移动.
  fixed 当页面的其余部分滚动时,背景图像不会移动.
  例:
  body
  {
  background-attachment:fixed;
  background-image:url(pic.jpg);
  }
background-position:{位置值} 属性设置背景图像的起始位置.
  top left
  top center
  top right
  center left
  center center
  center right
  bottom left
  bottom center
  bottom right
  x% y%
  xpos ypos
  使用百分数定位时,其实是将背景图片的百分比指定的位置和元素的百分比位置对齐.也就是说,百分数定位是改变了背景图和元素的对齐基点.不再像使用像素和关键词定位时,使用背景图和元素的左上角为对齐基点.例如上例的background-position:100% 50%; 就是将背景图片的100%(right) 50%(center)这个点,和元素的100%(right) 50%(center)这个点对齐.
  使用数值需要注意的是,当只有一个数值时,这个值将用于横坐标,纵坐标将默认是50%.
  例:
   body
  {
  background-image:url(pic.jpg);
  background-position:top;
  }