zoukankan      html  css  js  c++  java
  • HTML&CSS基础-背景的简写属性

                 HTML&CSS基础-背景的简写属性

                                              作者:尹正杰

    版权声明:原创作品,谢绝转载!否则将追究法律责任。

    一.HTML源代码

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title>背景的简写属性</title>
        </head>
            <style type="text/css">
                body{
                    height: 5000px;
                    /*设置一个颜色*/
                    /*background-color: deeppink;*/    
                    /*设置一个图片背景*/
                    /*background-image: url(img/02.png);*/
                    /*设置背景图片不重复*/
                    /*background-repeat: no-repeat;*/
                    /*设置图片背景位置*/
                    /*background-position: center center;*/
                    /*设置背景图片不随滚动条滚动*/
                    background-attachment: fixed;
                    
                    /**
                     *     background:
                     *         通过该属性可以同时设置所有背景相关的样式,没有顺序的要求,谁在前谁在后都行;
                     *         该属性也没有数量的要求,不写的样式就使用默认值。
                     */
                    background: yellow url(img/02.png) no-repeat center center fixed ;
                }
            </style>
        <body>
        </body>
    </html>

    二.浏览器打开以上代码渲染结果

  • 相关阅读:
    Docker
    dcoker-componse-2
    MyBatis的基本使用
    SpringMVC实现文件上传和下载
    CF817E Choosing The Commander
    CSP 2020 游记
    COCI2014-2015 Contest#1 题目选做
    CF590D Top Secret Task
    LuoguP1937 [USACO10MAR]Barn Allocation G
    CF741C Arpa’s overnight party and Mehrdad’s silent entering
  • 原文地址:https://www.cnblogs.com/yinzhengjie/p/8836242.html
Copyright © 2011-2022 走看看