day10

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/
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1、如何设置边框线 例子: 2、如何让背景图片有阴影 例子: 3、如何设置上选框 例子: 4、应该运用上的网址
    陈梦晴阅读 263评论 0 0
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,663评论 25 708
  • CSS盒模型: 网页中所有的元素都是矩形的,可以看做是一个个盒子。 网页由多个盒子组成。 盒子:边框+内边距+内容...
    无关风月s阅读 244评论 0 0
  • 夜空高远, 没有星星, 长廊上的石墩 整齐而安静, 与平行的路灯 深情对望, 海浪一阵阵地 拍打着海滩, 不甘寂寞...
    墨默天地阅读 304评论 2 8
  • 路边上不起眼的小草 也在这个季节开出 白色小花 它细微到 很多人会忽略到它 但它依然活的炙热 在这浩瀚宇宙里 我们...
    悠然小妖阅读 347评论 0 3