Typically, we want to center an element and do this:
#element {margin:0 Auto;}
What if you want to fix this element position? Generally we will add position:fixed, as follows:
#element {position:fixed;margin:0 Auto;}
But the result is that the element is not centered. This indicates that the fixedthe object is out of normal document flow.
Solution:
#element {position:fixed;margin:0 auto;left:0;right:0;}
However, you will not be able to work in a version below IE7 to change it to:
#element {position:fixed;margin:0 Auto;left:auto;right:auto;}
Finally we can do this:
if ($.browser.msie && parseint ($.browser.version) <= 7) { stralertwrapper.css ({position: ' fixed ', Bottom: ' 0 ', Height: ' Auto ', left: ' Auto ', right: ' Auto '}; }
Example code: http://jsfiddle.net/4Ly4B/33/
If it is helpful to you, welcome to join: QQ Group:124116463, discuss the front-end technology together!