位置固定和Internet Explorer [英] Position fixed and Internet Explorer

查看:93
本文介绍了位置固定和Internet Explorer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的CSS。它在Firefox中正常工作,但在IE中不工作。

this is my css. It is working fine in firefox but not working in IE.

#Createinner {
    position: fixed; 
    width: 400px; 
    height: 280px; 
    margin-left: -200px; 
    margin-top: -140px; 
    top: 50%; 
    left: 50%; 
    background-color: #ccc; 
}

如何解决这个问题。

提前感谢

推荐答案

只需在页面顶部添加DocType标记

Simply add DocType Tag on top of the page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

这篇关于位置固定和Internet Explorer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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