[問題] fixed在IE 8 沒有作用

看板Web_Design作者 (網路只是噓你世界)時間15年前 (2010/08/19 10:04), 編輯推噓3(309)
留言12則, 6人參與, 最新討論串1/1
我想做一個像facebook一樣永遠停駐在右下方的好友名單視窗 我使用了position:fixed 在ff3.0是可以work的 但在ie8 無法執行,請問有沒有什麼方法? 讓IE8 與firefox都能執行 下面附上我的html- ---------------------------------------- <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir ="ltr" xmlns ="" rel="nofollow">http://www.w3.org/1999/xhtml"> <head><meta content="zh-tw" http-equiv="Content-Language" /><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title> 123 </title> <style type ="text/css"> #form1{ margin: 10px auto 0 auto ; background-color : #FFFFCC; width : 80%; height : 100%; } body{ margin: 0px; padding: 0px; background-image : url('header.png'); background-repeat : repeat-x; text-align : center; } #friend { position: fixed; bottom: 0px; width: 150px; background-color: #99CCFF; right: 0px; height: 25px; z-index: 1; } </style> </head> <body> <form name="form1" method="post" action="FakeBook.aspx" id="form1"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEyNDI4Nzc3ODlkZBcTwPSHJdv7/O/yA1sXnhpGLHRG" /> </div> 123 </form><div id="friend" > </div> </body> </html > -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.32.9.209

08/19 10:13, , 1F
肯定是進入Quirks模式了~
08/19 10:13, 1F

08/19 12:10, , 2F
第一行<! DOCTYPE 沒有空格 <!DOCTYPE才對...
08/19 12:10, 2F

08/19 12:24, , 3F
樓上眼好尖!
08/19 12:24, 3F

08/19 12:31, , 4F
因為ie是白痴~容錯性太低了!!
08/19 12:31, 4F

08/19 12:49, , 5F
謝謝kajane 不過我現在又有一個新的問題 我的form1
08/19 12:49, 5F

08/19 12:50, , 6F
原本可以展開到整個頁面的最底部 現在卻會整個縮起來
08/19 12:50, 6F

08/19 12:56, , 7F
我希望的效果是內容不足一頁時form1能展開高度到100%
08/19 12:56, 7F

08/19 12:56, , 8F
超過一頁時 form1會隨著內容長大
08/19 12:56, 8F

08/19 15:15, , 9F
DOCTYPE 後面的http那段刪掉~如果還是不行~再改成html 4.0
08/19 15:15, 9F

08/19 15:16, , 10F
^前面的xhtml
08/19 15:16, 10F

08/23 09:36, , 11F
感謝這篇,我也有同樣的問題,結果後來發現只是因為我在
08/23 09:36, 11F

08/23 09:37, , 12F
DOCTYPE前面加了一行註解,IE就自動跑進Quirks mode
08/23 09:37, 12F
文章代碼(AID): #1CR94KCE (Web_Design)