CSS Position Fixed Not Working in IE 11

 ̄綄美尐妖づ 提交于 2019-12-07 05:52:17

问题


I have an image gallery, with captions across the bottom (upper image). The captions use position:fixed; bottom:0;, and works in every browser but IE, even the latest version (11.096…). The caption is fixed to the top of the screen, instead of the bottom (lower image).

I tried some of the suggestions I found while researching this on my own:

  • Verified the correct doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
  • Added <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  • Added expressions to my CSS:
    position:fixed; _position:absolute; bottom:0; _top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);

What am I missing here?


回答1:


  1. Try using position: expression(fixed);

  2. Try using position: relative; on the parent element and position: absolute; on your caption. This is cross-browser.



来源:https://stackoverflow.com/questions/29170622/css-position-fixed-not-working-in-ie-11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!