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>

  • 相关阅读:
    sql number类型和varchar2类型
    B
    E
    D
    B
    A
    第三课 选区
    第二课 新建文件与图层
    第一课 界面认识
    CSS命名规则
  • 原文地址:https://www.cnblogs.com/pcjbk/p/9782281.html
Copyright © 2011-2022 走看看