简体   繁体   English

页面对齐到中心IE9

[英]Page aligned to center IE9

On this site I'm gonna offer this Xmas to my brothers-in-law, I have a page structure like this: 在这个网站上,我将这个圣诞节提供给我的姐夫,我的页面结构如下:

<body>
    <div id="container">
        <div id="menu">[...]</div>
        <div id="wrapper">
            <div id="section1">[...]</div>
            <div id="section2">[...]</div>
            etc etc etc
        </div>
    </div>
</body>

All looks perfect on Firefox... but on my IE9, the page isn't aligned and the @font-face isn't loading either... 一切在Firefox上看起来都很完美...但是在我的IE9上,页面未对齐,并且@ font-face也未加载...

The CSS goes like this (looks to me there's no problem here) CSS就像这样(在我看来,这里没有问题)

#container{width:960px;margin:0 auto;position:relative}
#wrapper{width:780px;float:right;margin-bottom:30px}
#menu{width:180px;float:left;background:url(../img/site/menu_bg.jpg) repeat-y right;height:100%;position:fixed;padding-top:55px}

Already tried a different set-ups with no change at all ... and I'm starting to rip my hair off here ... any suggestions? 已经尝试了完全不同的其他设置...并且我开始在这里撕扯头发...有什么建议吗?

Thanks in advance. 提前致谢。

PS: If it helps ... the page in question is: www.sweetdreams.pt/escondido.php PS:如果有帮助...有问题的页面是:www.sweetdreams.pt/escondido.php

EDIT: As requested ... this is the beggining of the code in the page: 编辑:根据要求...这是页面中代码的开头:

<?php if(!ob_start("ob_gzhandler")) ob_start(); ?>
<!DOCTYPE html>
<html lang="pt-PT">

Are you by any chance running IE in Compatibility Mode? 您是否有机会在兼容模式下运行IE? (check this by pressing F12 and looking at the Developer tools below in the browser window. (通过按F12并在浏览器窗口中查看下面的开发人员工具来进行检查。

EDIT: 编辑:

In IE, it pays to have a DOCTYPE declaration, otherwise it will just go to Quirks mode. 在IE中,要有DOCTYPE声明是值得的,否则它将进入Quirks模式。

Please do post full HTML source. 请发布完整的HTML源代码。

The document type declaration must be at the very first line in the file, otherways it's ignored. 文档类型声明必须位于文件的第一行,否则将被忽略。 It also must not preceeded by any characters, ie no blank lines, spaces, tabs, nothing, just <!DOCTYPE html> . 它也不能以任何字符开头,即没有空行,空格,制表符,什么都没有,只有<!DOCTYPE html>

instead of { margin: 0 auto; 而不是{margin:0 auto; } try... 尝试...

#container {
    position: absolute;
    left: 50%;
    width: 960px;
    margin-left: -480px; /* half of width */
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM