zoukankan      html  css  js  c++  java
  • html-背景图片固定,复合样式

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css" media="screen">
    body{ 980px;
    height: 5000px;
    background-color: pink;
    background-image: url(img/1.jpg); /*引入背景图片*/
    background-repeat: no-repeat; /*不平铺*/
    background-attachment: fixed; /*北景图片固定*/
    background-position: center 0px; /*居中*/
    /*上面的单一样式写法,下面是复合样式写法*/

    background:pink url(img/1.jpg) no-repeat fixed center 1px; /*复合样式的写法*/
    </style>
    </head>
    <body>
    <div>aaa</div>
    <div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>

    </body>
    </html>

  • 相关阅读:
    web-9. 动态网页与数据库-2
    web-9. 动态网页与数据库
    web-8. 多框架页面的创建
    web-7. 丰富页面的多媒体
    web-6. 组织页面的表格
    yocto术语二
    yocto术语
    linux source
    linux 添加环境变量
    ubuntu上网
  • 原文地址:https://www.cnblogs.com/pcjbk/p/9782281.html
Copyright © 2011-2022 走看看