6 var float = document
.getElementById("float");
7 var float2
= document
.getElementById("float2");
8 document
.body
.offsetHeight
;
9 float.parentNode
.style
.height
= "40px";
10 document
.body
.offsetTop
;
11 float.parentNode
.removeChild(float);
12 document
.body
.offsetLeft
;
13 float2
.parentNode
.style
.height
= "40px";
14 document
.body
.offsetTop
;
15 float2
.parentNode
.removeChild(float2
);
16 document
.body
.offsetLeft
;
20 <body onload=
"test()">
21 <div style=
"height: 20px;">
22 <div style=
"background-color: gray;">
23 <div id=
"float" style=
"float: left; height: 30px; background-color: blue; width: 100px;"></div>
26 <div style=
"background-color: silver; height: 80px;">
29 <div style=
"height: 20px;">
30 <div style=
"background-color: gray;">
31 <div id=
"float2" style=
"float: left; height: 30px; background-color: blue; width: 100px;"></div>
34 <div style=
"background-color: silver; height: 80px;">
35 <div>This line should start at the left margin.
</div>
37 <div style=
"height: 20px;">
38 <div style=
"background-color: gray; height: 40px;">
39 <div style=
"float: left; height: 30px; background-color: blue; width: 100px;"></div>
42 <div style=
"background-color: silver; height: 80px;">
43 This line should not overlap the blue box.