找回密碼
 註冊
搜索
查看: 2377|回復: 1

[教學] IE6 position:fixed Hack

  [複製鏈接]
發表於 2010-4-10 17:10:23 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
IE6 不支援 position:fixed

網路上有很多說明IE6 要如何模擬其他瀏覽器支援 position:fixed的方式

例如:


  1. html, body{

  2. margin:0;

  3. padding:0;

  4. }



  5. #fixed {

  6. position:fixed;

  7. width:380px;

  8. top:0px;

  9. right:100px;

  10. }





  11. * html {

  12. overflow: hidden;

  13. }



  14. * html body,

  15. * html #wrapper {

  16. position:relative;

  17. width:100%;

  18. height:100%;

  19. overflow:auto;

  20. }



  21. * html #fixed {

  22. position:absolute;

  23. }
  24. html, body {height: 100%;overflow: auto; }

  25. div{position:absolute;}

  26. body>div{position:fixed;}
複製代碼


position:fixed 的用途,像是廣告、選單,需要固定在頁面上某個位置時,都可以用 position:fixed 來處理。
 
發表於 2012-3-11 00:58:51 | 顯示全部樓層
哈哈,看的人少,回一下  
版主招募中
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-5-1 18:25 , Processed in 0.021242 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表