zoukankan      html  css  js  c++  java
  • CSS背景和列表

    css背景样式

    css列表样式

     

     

    同时设置背景颜色和背景图片时,背景图片会覆盖背景颜色。

     

     

     

     

     

     

     

     

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div{
                width: 100%;
                height: 1500px;
                border: 1px solid #ff0000;
                background: #000000 url(img/bg-little.png) no-repeat right fixed;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div{
                width: 300px;
                height: 1500px;
                background-image: url(img/bg-little.png);
                background-repeat: no-repeat;
                border: 1px solid #ff0000;
                /*background-attachment: fixed;*/
                background-attachment: scroll;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div{
                width: 300px;
                height: 300px;
                /*background-color: transparent;*/
                /*background-color: red;*/
                /*background-color: #ff0000;*/
                background-color: rgb(255,0,0);
                /*padding: 10px;*/
                /*margin: 10px;*/
                border: 20px dashed;
            }
        </style>
    </head>
    <body>
        <div>background-color</div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div{
                width: 300px;
                height: 300px;
                background-color: #ff0000;
                
                background-image: url(img/bg-little.png);
                /*padding: 20px;*/
                /*margin: 20px;*/
                /*border: 20px dashed; */
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div{
                width: 300px;
                height: 1500px;
                background-image: url(img/bg-little.png);
                background-repeat: no-repeat;
                border: 1px solid #ff0000;
                background-position: bottom left;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            div{
                width: 300px;
                height: 300px;
                background-image: url(img/bg-little.png);
                background-repeat: no-repeat;
                /*background-repeat:repeat;*/
                /*background-repeat:repeat-x;*/
                /*background-repeat:repeat-y;*/
                border: 1px solid #ff0000;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            ul li {
                list-style: url(img/remind.png) inside square  ;
            }
        </style>
    </head>
    <body>
        <ul>
            <li>家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器</li>
            <li>电脑</li>
            <li>手机</li>
        </ul>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            ul li {
                list-style-image: url(img/remind.png);
            }
        </style>
    </head>
    <body>
        <ul>
            <li>家用电器</li>
            <li>电脑</li>
            <li>手机</li>
        </ul>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            ul li {
                list-style-image: url(img/remind.png);
                list-style-position: inside;
            }
        </style>
    </head>
    <body>
        <ul>
            <li>家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器家用电器</li>
            <li>电脑</li>
            <li>手机</li>
        </ul>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            ul li {
                /*list-style-type: circle;*/
                /*list-style-type: square;*/
                /*有序列表*/
                /*list-style-type: decimal;*/
                /*list-style-type: upper-roman;*/
                list-style-type: upper-alpha;
            }
        </style>
    </head>
    <body>
        <ul>
            <li>家用电器</li>
            <li>电脑</li>
            <li>手机</li>
        </ul>
    </body>
    </html>
  • 相关阅读:
    不用循如何计算数组累加和
    mysql通过binlog恢复删除数据
    windows下打开binlog
    mysql的binlog
    枚举实现线程池单例
    AtomicInteger的CAS算法浅析
    不用循环如何计算1累加到100
    MongoDB查询报错:class com.mongodb.MongoSecurityException: Exception authenticating MongoCredential
    Senparc.Weixin微信开发(3) 自定义菜单与获取用户组
    Senparc.Weixin微信开发(2) 消息机制和上下文(Session)
  • 原文地址:https://www.cnblogs.com/zengyu1234/p/15725666.html
Copyright © 2011-2022 走看看