人生若只如初见(1)

2018-09-28  本文已影响0人  Pamcore

盒子模型

content、margin、padding、border;
(IE盒模型和标准盒模型的区别)———IE盒模型的content包括border、padding

position的static、relative、absolute、fixed它们的区别?

水平居中

<div class="div-demo"></div>
<style>
    .div-demo {
        width:100px;
        height:100px;
        background-color:#06c;
        margin: auto;
        position:absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
    }
</style>
<style>
    .div-demo {
        width:100px;
        height:100px;
        background-color:#06c;
        margin: auto;
        position:absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
    }
</style>
<body class="container">
    <div class="div-demo"></div>
    <style>

        html,body {
            height:100%;
        }
        .container {
            display: box;
            display: -webkit-box;
            display: flex;
            display: -webkit-flex;
            -webkit-box-pack: center;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-box-align: center;
            -webkit-align-items: center;
            align-items: center;
        }
        .div-demo {
            width:100px;
            height:100px;
            background-color:#06c;
        }
    </style>

</body>

三角形icon

<body class="container">
    <div class="div-angles"></div>
    <div class="div-angles right"></div>
    <div class="div-angles bottom"></div>
    <div class="div-angles left"></div>
    <style>

        html,body {
            height:100%;
        }
        .container {
            display: box;
            display: -webkit-box;
            display: flex;
            display: -webkit-flex;
            -webkit-box-pack: center;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-box-align: center;
            -webkit-align-items: center;
            align-items: center;
        }
        .div-angles {
            width: 0;
            height: 0;
            border-style: solid;
            border-width:30px;
            width:0px;
            height:0px;
            border-color: transparent transparent #06c transparent;
        }
        .right {
            border-color: transparent transparent transparent #06c ;
        }
        .bottom {
            border-color: #06c transparent transparent ;
        }
        .left {
            border-color: transparent #06c transparent transparent;
        }
    </style>

</body>

什么是外边距合并,项目中是否有遇到过?

BFC、

:before 和 :after两伪元素,平时都是使用双冒号还是单冒号? 有什么区别?以及它们的作用:

Chrome、Safari等浏览器,当表单提交用户选择记住密码后,下次自动填充表单的背景变成黄色,影响了视觉体验是否可以修改?

<style>
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
  background-color: #fff;//设置成元素原本的颜色
  background-image: none;
  color: rgb(0, 0, 0);
}
</style>

浏览器的最小字体为12px,如果还想再小,该怎么做?

移动端的边框0.5px,你有几种方式实现?

上一篇 下一篇

猜你喜欢

热点阅读