TShopping

標題: IE6 position:fixed Hack [打印本頁]

作者: woff    時間: 2010-4-10 17:10
標題: IE6 position:fixed Hack
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 來處理。

作者: 000plmook    時間: 2012-3-11 00:58
哈哈,看的人少,回一下  




歡迎光臨 TShopping (http://www.tshopping.com.tw/) Powered by Discuz! X3.2