IE6 不支援 position:fixed
網路上有很多說明IE6 要如何模擬其他瀏覽器支援 position:fixed的方式
例如: -
- html, body{
- margin:0;
- padding:0;
- }
- #fixed {
- position:fixed;
- width:380px;
- top:0px;
- right:100px;
- }
- * html {
- overflow: hidden;
- }
- * html body,
- * html #wrapper {
- position:relative;
- width:100%;
- height:100%;
- overflow:auto;
- }
- * html #fixed {
- position:absolute;
- }
- html, body {height: 100%;overflow: auto; }
- div{position:absolute;}
- body>div{position:fixed;}
複製代碼
position:fixed 的用途,像是廣告、選單,需要固定在頁面上某個位置時,都可以用 position:fixed 來處理。 |