定義
haslayout是IE7-瀏覽器的特有屬性。hasLayout是一種只讀屬性,有兩種狀態(tài):true或false汁胆。當(dāng)其為true時蹋凝,代表該元素有自己的布局,否則代表該元素的布局繼承于父元素闺兢。
[注意]通過element.currentStyle.hasLayout可以得出當(dāng)前元素的hasLayout情況
HTML標簽
默認觸發(fā)hasLayout的有如下HTML標簽:
【1】html,body
【2】table,tr,th,td
【3】img
【4】hr
【5】input,button,select,textarea,fieldset
【6】frameset,frame,iframe
CSS屬性
可以觸發(fā)hasLayout的有如下CSS屬性:
【1】display:inline-block
【2】height/width:除了auto
【3】float:left/right
【4】position:absolute
【5】writing-mode(IE專有屬性,設(shè)置文本的垂直顯示):tb-rl
【6】zoom(IE專有屬性,設(shè)置或檢索對象的縮放比例):除了normal
【IE7專有的觸發(fā)hasLayout的CSS屬性】
【1】min-height/max-height/min-width/max-width:除none
【2】overflow\overflow-x\overflow-y:除visible
【3】position:fixed