day10

作者: 向钱看丷向厚赚 | 来源:发表于2017-09-06 22:04 被阅读0次

    A、我今天学到了什么

    1、如何设置边框线

    例子:

    //HTML
    div class="parent center row">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    

    //CSS

       *{
                margin:0 ;
                padding: 0;
            }
            .center{
                margin-right: auto;
                margin-left: auto;
            }
           .parent{
               width: 1240px;
               height: 400px;
               border: 1px solid #cccccc;
           }
           .row:after{
               content: "";
               display: table;
           }
    
            .parent>div{
                float: left;
                width: 25%;
                height: 400px;
                position: relative;
    
            }
            .parent>div:before{
                content: "";
                display:table;
                width: 100%;
                height: 100%;
                position: absolute;
                z-index: 100;
                border-right:1px solid #cccccc ;
            }
    

    2、如何让背景图片有阴影

    //HTML
         <ul class="content">
                    <li class="one">
                ![](images/8-1.jpg)
                     <a href=""></a>
                    </li>
    
    

    //CSS

    .sixth ul li{
        width: 25%;
        height: 200px;
        float: left;
        box-sizing: border-box;
    }
    .sixth ul li:not(:first-child){
        border-left: 1px solid #999999;
    }
    .sixth .trend .content>li{
        position: relative;
    }
    .sixth ul li:hover >a {
        width: 100%;
        height: 100%;
        display: block;
        position: absolute;
        top: 0;
        box-shadow: 0 0 20px 2px #e6e6e6 inset;
    }
    

    3、如何设置上选框

    例子:

    简易的:
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
            <style>
                *{
                    margin: 0;
                    padding: 0;
                }
                .box{
                    margin: 100px auto;
                    width: 80px;
                    height:30px;
                    background-color: greenyellow;
                    box-sizing: border-box;
                    position: relative;
                }
                .one{
                    position: absolute;
                    width: 80px;
                    height: 30px;
                    top: -30px;
                    background: oldlace;
                    display: none;
                    
                }
                .box:hover .one{
                    display: block;
                }
            </style>
        </head>
        <body>
            <div class="box">
                <p class="one">aaaaa</p>
                <p class="two">bbbbb</p>
            </div>
        </body>
    </html>
    

    复杂的:

    //HTML
    <div class="footer center ">
    <div class="box ">
        <div class="box-first">
            中文
            <span></span>
        </div>
        <div class="box-last">
            English
        </div>
    </div>
        </div>
    

    //CSS

      .box{
                margin-top: 50px;
                float: right;
                position: relative;
            }
            .box-first{
                width: 110px;
                height: 45px;
                text-align: center;
                line-height: 52px;
                background: url("img/language.png")  no-repeat 12px 19px;
                color: blue;
    
            }
            .box-first>span{
                width: 0;
                height: 0;
                border: 4px solid transparent;
                border-top-color: black;
                position: relative;
                top: 10px;right: -5px;
            }
            .box-last{
                width: 110px;
                height: 45px;
                text-align: center;
                line-height: 45px;
                box-shadow: 0px 0px 1px 1px #e6e6e6;
                position: absolute;
                top: -45px;
                z-index: 1000;
                background: honeydew url("img/language.png")  no-repeat 12px -15px;
                color: blue;
                text-indent: 15px;
                display: none;
    
            }
            .box:hover>.box-last{
                display: block;
                border-top-left-radius: 5px;
                border-top-right-radius: 5px;
            }
            .box:hover>.box-first{
                border-width: 1px;
                border-bottom-left-radius: 5px;
                border-bottom-right-radius: 5px;
                border-color:#cccccc;
                border-style: solid;
            }
            .box:hover>.box-first>span{
                border-bottom-color: black;
                border-top-color: transparent;
                top: -15px;
            }
    
    4、应该运用上的网址
    //码云
    https://git.oschina.net/
    
    //Ant Design Users
    https://github.com/ant-design/ant-design/issues/477
    
    //ICONFONT
    http://www.iconfont.cn/
    

    B、今天我掌握了什么

    1、如何设置边框线

    例子:

    //HTML
    div class="parent center row">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
    

    //CSS

       *{
                margin:0 ;
                padding: 0;
            }
            .center{
                margin-right: auto;
                margin-left: auto;
            }
           .parent{
               width: 1240px;
               height: 400px;
               border: 1px solid #cccccc;
           }
           .row:after{
               content: "";
               display: table;
           }
    
            .parent>div{
                float: left;
                width: 25%;
                height: 400px;
                position: relative;
    
            }
            .parent>div:before{
                content: "";
                display:table;
                width: 100%;
                height: 100%;
                position: absolute;
                z-index: 100;
                border-right:1px solid #cccccc ;
            }
    

    2、如何让背景图片有阴影

    //HTML
         <ul class="content">
                    <li class="one">
                ![](images/8-1.jpg)
                     <a href=""></a>
                    </li>
    
    

    //CSS

    .sixth ul li{
        width: 25%;
        height: 200px;
        float: left;
        box-sizing: border-box;
    }
    .sixth ul li:not(:first-child){
        border-left: 1px solid #999999;
    }
    .sixth .trend .content>li{
        position: relative;
    }
    .sixth ul li:hover >a {
        width: 100%;
        height: 100%;
        display: block;
        position: absolute;
        top: 0;
        box-shadow: 0 0 20px 2px #e6e6e6 inset;
    }
    

    C、今天我没有掌握什么

    3、如何设置上选框

    例子:

    简易的:
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
            <style>
                *{
                    margin: 0;
                    padding: 0;
                }
                .box{
                    margin: 100px auto;
                    width: 80px;
                    height:30px;
                    background-color: greenyellow;
                    box-sizing: border-box;
                    position: relative;
                }
                .one{
                    position: absolute;
                    width: 80px;
                    height: 30px;
                    top: -30px;
                    background: oldlace;
                    display: none;
                    
                }
                .box:hover .one{
                    display: block;
                }
            </style>
        </head>
        <body>
            <div class="box">
                <p class="one">aaaaa</p>
                <p class="two">bbbbb</p>
            </div>
        </body>
    </html>
    

    复杂的:

    //HTML
    <div class="footer center ">
    <div class="box ">
        <div class="box-first">
            中文
            <span></span>
        </div>
        <div class="box-last">
            English
        </div>
    </div>
        </div>
    

    //CSS

      .box{
                margin-top: 50px;
                float: right;
                position: relative;
            }
            .box-first{
                width: 110px;
                height: 45px;
                text-align: center;
                line-height: 52px;
                background: url("img/language.png")  no-repeat 12px 19px;
                color: blue;
    
            }
            .box-first>span{
                width: 0;
                height: 0;
                border: 4px solid transparent;
                border-top-color: black;
                position: relative;
                top: 10px;right: -5px;
            }
            .box-last{
                width: 110px;
                height: 45px;
                text-align: center;
                line-height: 45px;
                box-shadow: 0px 0px 1px 1px #e6e6e6;
                position: absolute;
                top: -45px;
                z-index: 1000;
                background: honeydew url("img/language.png")  no-repeat 12px -15px;
                color: blue;
                text-indent: 15px;
                display: none;
    
            }
            .box:hover>.box-last{
                display: block;
                border-top-left-radius: 5px;
                border-top-right-radius: 5px;
            }
            .box:hover>.box-first{
                border-width: 1px;
                border-bottom-left-radius: 5px;
                border-bottom-right-radius: 5px;
                border-color:#cccccc;
                border-style: solid;
            }
            .box:hover>.box-first>span{
                border-bottom-color: black;
                border-top-color: transparent;
                top: -15px;
            }
    
    4、应该运用上的网址
    //码云
    https://git.oschina.net/
    
    //Ant Design Users
    https://github.com/ant-design/ant-design/issues/477
    
    //ICONFONT
    http://www.iconfont.cn/
    

    相关文章

      网友评论

        本文标题:day10

        本文链接:https://www.haomeiwen.com/subject/yttbjxtx.html