{hasLayout} Trident Proprietary CSS Property | CSS: Presentation Layer
Standards Based Development
hasLayout property gets a value that indicates whether the object has layout. Accepts two keyword values: true (if the object has layout) and false (if the object does not have layout); false is default.
| Property | Value |
|---|---|
display | inline-block |
height | any value |
styleFloat (float) | left or right |
position | absolute |
width | any value |
writingMode (-ms-writing-mode) | tb-rl |
zoom | any value |
Setting contentEditable:true will also cause an element to gain layout.
The following elements always have layout: body, HTMLInputElement (input /), table, and td.
As of ie6, when !DOCTYPE specifies strict standards compliance, inline elements ignore width and height. Setting each or both will not cause an element to have layout.
The example uses hasLayout to determine whether an object has layout. View it live:
<DIV ID="oWidthSet" STYLE="width:100%">
DIV element A has its width set to 100%.</DIV>
<DIV ID="oNotSet">DIV element B is not positioned,
and neither its height nor width is set.</DIV>
<P>Which DIV element has layout?</P>
<BUTTON onclick="alert(oWidthSet.currentStyle.hasLayout)">
DIV Element A</BUTTON>
<BUTTON onclick="alert(oNotSet.currentStyle.hasLayout)">
DIV Element B</BUTTON>