Use js to define the function parameters of a function in the browser where the left and right floating elements are located relative to the width of the page body: elem element and page body width (for example, 990 and 950 width) the left margin between elem and the page subject DIV. First, the position of this element is fixed.
Top is (clientHeight-elem.offsetHeight)/2 (that is, the element is in the middle of the browser, this is fixed)
Left is (clientWidht-subject width)/2 + Subject width + left margin. The left margin can be set to positive or negative, if it is a negative number, the absolute value equals the subject width + elem. offsetWidht, then the elements are just floating on the left side of the page body. When it is set to 0, the elements are just floating on the right side of the page body.
However, ie6 does not support the fixed attribute in css. Fortunately, ie6 can be solved through the expresion expression.
Specific Code:
The Code is as follows:
Floating Element
Foot home