问题
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:
Try using
position: expression(fixed);
Try using
position: relative;
on the parent element andposition: absolute;
on your caption. This is cross-browser.
来源:https://stackoverflow.com/questions/29170622/css-position-fixed-not-working-in-ie-11