存储大小css
过时时间html
<div style="height: 1px;overflow:hidden;"></div>
区分用户是人仍是机器,能够防止恶意破解密码、刷票等;能够防止黑客对某一特定注册用户以暴力破解的方式不断的尝试登陆web
data-*用于存储页面或者应用程序的私有自定义的数据,能够在全部的html元素中嵌入data-自定义属性,能够被js利用来操做数据canvas
注意:data属性应该为小写,且data-后至少要有一个字符,不能单单使用data,data属性值能够是任意字符串
新特性:浏览器
移除的元素 安全
浏览器种类众多,不一样浏览器的默认样式不同,须要进行reset统一浏览器的样式服务器
// html <div class="box"> <div class="left">fff</div> <div class="right">dddf</div> </div> // css .left{ float: left; background: red; /*display: inline-block;*/ } .right{ overflow: hidden; background: green; /*display: inline-block;*/ }
.left{ float: left; width: 300px; background: red; } .right{ overflow: hidden; background: green; }
// html <div class="box"> <div class="left">fff</div> <div class="right">ddddd</div> <div class="center">ss</div> </div> // css .left{ float: left; background: red; } .right{ float: right; background: green; } .center{ margin: 0 auto; background: yellow; }
父元素设置display:flex;左边定宽width:300px;右边定宽width:300px;中间设置flex-grow:1websocket
// html <div class="box"> <div class="left">fff</div> <div class="center">ss</div> <div class="right">ddddd</div> </div> // css .box{ display: flex; } .left{ width: 300px; background: red; } .right{ width: 300px; background: green; } .center{ flex-grow: 1; background: yellow; }
.left{ position: absolute; top: 0; left: 0; width: 300px; background: red; } .right{ position: absolute; right: 0; top: 0; width: 300px; background: green; } .center{ margin: 0 300px; background: yellow; }
实际上是利用负margin值实现,也就是固比固(两边盒子宽度固定,中间盒子自适应)cookie
<div class="box"> <div class="center col">dgdggdgdsgdsfhsgkjsdflkghjsdkghsdghsdhg dhgsdhgsdghsdhgjdhkghsdghsdghskdjhgsdhfgsdfhg</div> <div class="left col"></div> <div class="right col"></div> </div> .box{ overflow: hidden; padding: 0 150px; } .left{ left: -150px; margin-left: -100%; width: 150px; height: 50px; background: red; } .right{ right: -150px; margin-left: -150px; width: 150px; height: 50px; background: green; } .center{ width: 100%; height: 50px; background: yellow; } .col{ position: relative; float: left; }
定位完成后,要进行position:relative;再左右两栏添加left和right值,使中间的内容不被遮盖session
<div class="box"> <div class="wrap col"> <div class="center">dgdggdgdsgdsfhsgkjsdflkghjsdkghsdghsdhg dhgsdhgsdghsdhgjdhkghsdghsdghskdjhgsdhfgsdfhg </div> </div> <div class="left col"></div> <div class="right col"></div> </div> .left{ margin-left: -100%; width: 150px; height: 50px; background: red; } .right{ margin-left: -150px; width: 150px; height: 50px; background: green; } .center{ width: 100%; height: 50px; background: yellow; } .col{ float: left; } .wrap{ margin: 0 150px; } 与圣杯布局只是中间的div增长了包含的容器,防止遮盖文字使用了在包含容器中设置margin:0 定宽值;
居中浮动元素
<div class="box"> <div class="right col"></div> </div> .right{ float:left; width: 150px; height: 50px; margin: 0 0 0 -75px; position: relative; left: 50%; top: 50%; background: green; }
居中绝对定位元素
.right{ position: absolute; width: 150px; height: 50px; margin: 0 auto; left: 0; top: 0; bottom: 0; right: 0; background: green; }
行框的排列会受到中间空白(回车或者空格)的影响,空格也属于字符,也会应用样式,占据空间
将字符大小设为0就能够将间隔去除
JS 部分等待更新