Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Position Fixed Not Working in IE 11

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).

How it should lookHow it looks in IE

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?

like image 917
Ty Morton Avatar asked Mar 20 '15 15:03

Ty Morton


1 Answers

  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.

like image 90
Ciprian Avatar answered Sep 21 '22 13:09

Ciprian