固定的CSS位置在IE 11中不起作用 [英] CSS Position Fixed Not Working in IE 11

查看:111
本文介绍了固定的CSS位置在IE 11中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图库,底部带有标题(上图)。字幕使用 position:fixed; bottom:0; ,并且可以在除IE以外的所有浏览器中使用,甚至可以使用最新版本(11.096…)。标题固定在屏幕顶部,而不是底部(下部图像)。

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:


  • 验证了正确的文档类型:<!DOCTYPE html PUBLIC-// W3C // DTD XHTML 1.0 Transitional // EN>

  • 添加了<元http-equiv = X-UA-Compatible content = IE = EmulateIE7 />

  • 在我的CSS中添加了表达式:

    position:fixed;
    _position:绝对;
    bottom:0;
    _top:expression(document.body.scrollTop + document.body.clientHeight-this.clientHeight);

  • 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);

我在这里缺少什么?

推荐答案


  1. 尝试使用位置:表达式(固定);

尝试使用位置:相对; 和标题上的 position:absolute; 。这是跨浏览器。

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

这篇关于固定的CSS位置在IE 11中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆