存儲大小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 部分等待更新