Differences between revisions 4 and 5
Revision 4 as of 2007-11-15 16:24:28
Size: 523
Editor: dslb-084-058-254-116
Comment:
Revision 5 as of 2007-11-15 16:25:30
Size: 802
Editor: dslb-084-058-254-116
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:

Example:
{{{
    <div id="test1" style="height: 50px; width: 300px; background-color: rgb(100,100,100);">width = 300px</div>
    <div id="test2" style="height: 50px; width: 300px; background-color: rgb(200,200,200); padding: 10px;">width = 300px; padding = 10px</div>
}}}

Demo for the invalid interpretation of the CSS box model by internet explorer < 6

[http://search.mpi-sb.mpg.de/markus/examples/box-modell/test1.php Test 1]

[http://search.mpi-sb.mpg.de/markus/examples/box-modell/test2.php Test 2 (quirks mode)]

style.width versus offsetWidth

style.width is a read/write property of an element and is the width of the content area of the object.

offsetWidth is a read-only property and means the effective width of the element including padding of the element.

Example:

    <div id="test1" style="height: 50px; width: 300px; background-color: rgb(100,100,100);">width = 300px</div>
    <div id="test2" style="height: 50px; width: 300px; background-color: rgb(200,200,200); padding: 10px;">width = 300px; padding = 10px</div>

CompleteSearch: completesearch/CSSBoxModel (last edited 2007-11-15 16:29:28 by dslb-084-058-254-116)