目前积累的前端小操作,望各位笑纳

主流浏览器的内核

浏览器名称: IE     Firefox       Google chrome      Safari (苹果专有)     Opera 

内核:    trident    Gecko        Webkit / blink      Webkit           presto

 

如何触发一个盒子的BFC:

position:absolute;
display:inline-block;
float:left/right;
overflow:hidden;

position:absolute和float:left/right;

从内部把元素转换为inline-bloack;

clear:both;清除浮动流;

::bofore:伪类在元素前

::after:伪类在元素后

 

单行文字打点方法:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>文字打点</title>
    <style>
        p{
            width: 300px;
            height: 20px;
            line-height: 20px;
            border: 1px solid black;

            /* 打点三式 */
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    </style>
</head>
<body>
    <p>君不见,黄河之水天上来,奔流到海不复回;君不见,高堂明镜悲白发,朝如青丝暮成雪。</p>
</body>
</html>

 

posted @ 2020-05-22 11:38  长恭  阅读(54)  评论(1)    收藏  举报