1.CSS的盒子模型
包含元素內容content
、內邊距padding
、邊框border
、外邊距margin
box-sizing
:border-box
;content-box
;inherit
;
1) content-box
:總寬度=margin+border+padding+width
,即爲標準模型;
2) border-box
:總寬度=margin+width
,即爲IE模型;
3) inherit
:繼承父元素的border-sizing
屬性。
2.AJAX的readyState幾種狀態
0
——初始化1
——載入2
——載入完成3
——解析4
——完成
3.常見的post提交數據方式對應的content-type取值
4
種
1)application/x-www-form-urlencoded
:數據被編碼爲名稱/值對,這是標準的編碼格式。
2)multipart/form-data
:數據被編碼爲一條消息,頁上的每個控件對應消息中的一個部分。
3)application/json
:告訴服務端消息主體是序列化後的 JSON
字符串.
4)text/xml
4.清除浮動的幾種方法
1)父級div
定義僞類:after
和zoom
`.clearfloat::after {display:block; clear:both; content:" "; visibility:hidden; height:0;}
.clearfloat {zoom:1}`
2)在結尾處添加空div
標籤clear:both
3)父級div
定義height
4)父級div
定義display:table
5)父級div
也一起浮動
6)父級div
定義overflow:auto/hidden
(必須定義width
或zoom:1
,同時不能定義height
,瀏覽器會自動檢查浮動區域的高度)
5.Webpack解析ES6用的插件
babel-loader
6.移動端上click事件在某些瀏覽器有沒有遇到延遲的問題
1)靜止縮放<meta name="viewport" content="width=device-width user-scalable='no' ">
或<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
2)引入`fastclick.jswindow.addEventListen
er(function(){
FastClick.attach(document.body);
1},false)`
7.HTTP的緩存機制
1)強制緩存:當所請求的數據在緩存數據庫中尚未過期時,不與服務器進行交互,直接使用緩存數據庫中的數據。Expire / Cache-Control
2)協商緩存:從緩存數據庫中取出緩存的標識,然後向瀏覽器發送請求驗證請求的數據是否已經更新,如果已更新則返回新的數據,若未更新則使用緩存數據庫中的緩存數據。etag / last-modifind