zoukankan      html  css  js  c++  java
  • 制作一个主页背景图不动,但网页可以向下滚动浏览内容

    <STYLE TYPE="text/css">
    <!--
    BODY {background-image: URL(图片地址);
    background-position: center; (背景图片居中显示)
    background-repeat: no-repeat; (不重复如果想重复则可以把no-repeat改成repeat)
    background-attachment: fixed;} (fixed固定)
    -->
    </STYLE>

    background-attachment -- 定义背景图片随滚动轴的移动方式
    • 取值: scroll | fixed | inherit
      • scroll: 随着页面的滚动轴背景图片将移动
      • fixed: 随着页面的滚动轴背景图片不会移动
      • inherit: 继承
    • 引用网址:http://www.dreamdu.com/css/property_background-attachment/
    • 初始值: scroll
    • 继承性: 否
    • 适用于: 所有元素
    • background:背景.attachment:附着.
  • 相关阅读:
    java--保留重复排序
    java--TreeSet比较器排序
    java--去重练习
    java--HashSet
    java--集合可变参数
    spring MVC入门
    java IO详解
    spring入门
    redis详解
    maven教程
  • 原文地址:https://www.cnblogs.com/yangjing1314/p/4047539.html
Copyright © 2011-2022 走看看