IE中的HTML/CSS登录页面样式问题无效

IE中的HTML/CSS登录页面样式问题无效,html,css,Html,Css,我有一个登录页面,在chrome、chrome(windows)、safari和firefox中似乎运行良好,但当我在IE中测试它时,在登录框和“忘记用户名或密码”链接之间似乎有一个巨大的缺口。我不知道这是为什么,有人能帮我解决这个问题吗 HTML: 演示:我修复了它,所以它在Chrome中看起来不错。看这个 我移动了登录表单div中的所有内容,并删除了任何位置:relative;来自CSS的东西。我不知道为什么任何东西都使用位置:相对;因为它把布局搞砸了 尽量不要超过us position:相

我有一个登录页面,在chrome、chrome(windows)、safari和firefox中似乎运行良好,但当我在IE中测试它时,在登录框和“忘记用户名或密码”链接之间似乎有一个巨大的缺口。我不知道这是为什么,有人能帮我解决这个问题吗

HTML:


演示:

我修复了它,所以它在Chrome中看起来不错。看这个

我移动了登录表单div中的所有内容,并删除了任何位置:relative;来自CSS的东西。我不知道为什么任何东西都使用位置:相对;因为它把布局搞砸了

尽量不要超过us position:相对和其他定位值,静态除外,这是默认值。另一个古老的建议是不要使用表格进行布局

HTML:

    <table cellpadding="0" cellspacing="0" id="maintable">
    <tbody>
        <tr>
            <td id="container">

                <div id="login_header">
                    <a href="#" id="homelink"></a>
                    <h1><b>TEST Vario Press CMS Demo</b></h1>
                    <div id="logo"></div>
                </div>

                <div id="content">
                    <!-- Begin Content -->

                    <div id="dialog">
                        <h2>Client Login</h2>

                        <div class="content">
                            <form action="#" name="login" id="login" method="post" accept-charset="utf-8" autocomplete="off" _lpchecked="1">
                                <div id="login_form">

                                    <div class="error"></div>

                                    Please enter your username and password
                                    <ul>
                                        <li id="username_field">
                                            <label>Username:</label>
                                            <input type="text" name="username" value="" id="username" onkeypress="return checkenter(event)">
                                        </li>
                                        <li id="password_field">
                                            <label>Password:</label>
                                            <input type="password" name="password" value="" onkeypress="return checkenter(event)">
                                        </li>
                                    </ul>
                                    <div class="ok_button" title="Login" onclick="login.submit()">
                                        <a href="#">GO</a>
                                    </div>

                                    <div class="button" id="submit_button">
                                        <input type="submit" name="submit_button" value="Login">
                                    </div>
                                </div>


                            </form>
                            <div id="login_links">
                                <div class="forgot">
                                    <a href="#">Forgot username or password?</a>
                                </div>
                                <div class="register">
                                    <a href="#">Register</a>
                                </div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </td>
        </tr>
    </tbody>
</table>
#login_header h1, #login_header #logo, #header h1 b {
    display:none;
}

#dialog {
    width:520px;
    margin:0 auto;
    text-align:center;
    color:#FFF;

}

#login_form {
    background-color:#808080;
    padding:18px;
    padding-bottom:42px;
    text-align:center;

}

#dialog, #dialog .error {
    color:#FFF;
}

#dialog h2 {
    background-color: #808080;
    background-image: url("../imgs/table_bg.gif");
    color:#fff;
    padding:9px;
    font-size:20px;
    text-align:left;
    margin:0px;
}

#dialog .content {
    padding:0;
    list-style: none;
}

#dialog .ok_button {
    display:none;
}

#dialog #submit_button input {
    padding:7px 5px;
    text-align: center;
}

#dialog .clear {
    display:none;
}

.search_button {
    background-image:url(../imgs/nav_ok.gif);
    background-repeat:no-repeat;
    background-position:left -2px;
    width:26px;
    height:30px;
    margin-top:2px;
    margin-right:12px;
    float:right;
    cursor:pointer;
}

.highlight_field {
    background-color:#f57921;
}

#forgot h3 {
    text-align:center;
}



#my_details {
    width:auto;
}

#loginpage #my_details {
    width:400px;
}

#forgot h3 {
    font-size: 12px;
}

#login ul {
    margin-left:8px;
    list-style: none;

}

#login ul input{
    width: 350px;
    height: 25px;
    padding-left: 10px;
    background-color: #FFF;
    border: none;
    border-width: 0px;
    position: relative;
    left: -20px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    behavior : url(../js/PIE.htc);

    /*
-moz-border-radius-topright: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;*/
}

#login_links {
    margin-top:0;
    text-align:left;
}

#login_links .forgot {
    float:none;
    display:block;
}

#login_links .register, #login_links .whyregister {
    display: none;
}

#login_links .forgot a {
    display:block;
    width:484px;
    color:#FFF;
    background-color:#808080;
    padding:18px;
    font-weight:normal;
    text-decoration: none;

}


#login_links .forgot a:hover {
    text-decoration: underline;

}

#login label {
    width:6em;
    display: block;
    text-align: left;
    /*float: left;*/
    line-height: 25px;
    margin-left: 22px;

}

#page_mydetails .recordset {
    width:48%;
}

.recordset h4 {
    font-size:11px;
    background-image:url(../imgs/table_bg.gif);
    background-color:#535c66;
    color:#fff;
    border-bottom:1px solid #FFFFFF;
    padding:9px;
}

.highlight {
    background-color:#f7b100;
    color:#000;
}

.highlight a, .highlight a:visited {
    color:#000;
}

#nav a:hover, #nav .active a {
    color:#f7b100;
}

#loginpage #content {
    padding-top:18px;

}

在ie9的哪个版本的ie中看起来很好。你的HTML标记不匹配。使用编辑器格式化代码,您将看到这一点。JSFIDLE甚至通过在
上涂上红色来警告这一点。总的来说,你的HTML是非常不可读的,我不知道这是否是如此格式化,或者如果你这样写。尝试通过此验证程序运行HTML。顺便说一句,在OSX下运行的最新Chrome中也出现了该帽。这不是渲染问题,只是HTML无效。@Hugo T HTML是预先编写的,我只是在修改everything@iNeed_anAnswer清理代码,尝试删除不需要的空格和制表符。这个问题在IE中很常见
    <table cellpadding="0" cellspacing="0" id="maintable">
    <tbody>
        <tr>
            <td id="container">

                <div id="login_header">
                    <a href="#" id="homelink"></a>
                    <h1><b>TEST Vario Press CMS Demo</b></h1>
                    <div id="logo"></div>
                </div>

                <div id="content">
                    <!-- Begin Content -->

                    <div id="dialog">
                        <h2>Client Login</h2>

                        <div class="content">
                            <form action="#" name="login" id="login" method="post" accept-charset="utf-8" autocomplete="off" _lpchecked="1">
                                <div id="login_form">

                                    <div class="error"></div>

                                    Please enter your username and password
                                    <ul>
                                        <li id="username_field">
                                            <label>Username:</label>
                                            <input type="text" name="username" value="" id="username" onkeypress="return checkenter(event)">
                                        </li>
                                        <li id="password_field">
                                            <label>Password:</label>
                                            <input type="password" name="password" value="" onkeypress="return checkenter(event)">
                                        </li>
                                    </ul>
                                    <div class="ok_button" title="Login" onclick="login.submit()">
                                        <a href="#">GO</a>
                                    </div>

                                    <div class="button" id="submit_button">
                                        <input type="submit" name="submit_button" value="Login">
                                    </div>
                                </div>


                            </form>
                            <div id="login_links">
                                <div class="forgot">
                                    <a href="#">Forgot username or password?</a>
                                </div>
                                <div class="register">
                                    <a href="#">Register</a>
                                </div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </td>
        </tr>
    </tbody>
</table>
#login_header h1, #login_header #logo, #header h1 b {
    display:none;
}

#dialog {
    width:520px;
    margin:0 auto;
    text-align:center;
    color:#FFF;

}

#login_form {
    background-color:#808080;
    padding:18px;
    padding-bottom:42px;
    text-align:center;

}

#dialog, #dialog .error {
    color:#FFF;
}

#dialog h2 {
    background-color: #808080;
    background-image: url("../imgs/table_bg.gif");
    color:#fff;
    padding:9px;
    font-size:20px;
    text-align:left;
    margin:0px;
}

#dialog .content {
    padding:0;
    list-style: none;
}

#dialog .ok_button {
    display:none;
}

#dialog #submit_button input {
    padding:7px 5px;
    text-align: center;
}

#dialog .clear {
    display:none;
}

.search_button {
    background-image:url(../imgs/nav_ok.gif);
    background-repeat:no-repeat;
    background-position:left -2px;
    width:26px;
    height:30px;
    margin-top:2px;
    margin-right:12px;
    float:right;
    cursor:pointer;
}

.highlight_field {
    background-color:#f57921;
}

#forgot h3 {
    text-align:center;
}



#my_details {
    width:auto;
}

#loginpage #my_details {
    width:400px;
}

#forgot h3 {
    font-size: 12px;
}

#login ul {
    margin-left:8px;
    list-style: none;

}

#login ul input{
    width: 350px;
    height: 25px;
    padding-left: 10px;
    background-color: #FFF;
    border: none;
    border-width: 0px;
    position: relative;
    left: -20px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    behavior : url(../js/PIE.htc);

    /*
-moz-border-radius-topright: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;*/
}

#login_links {
    margin-top:0;
    text-align:left;
}

#login_links .forgot {
    float:none;
    display:block;
}

#login_links .register, #login_links .whyregister {
    display: none;
}

#login_links .forgot a {
    display:block;
    width:484px;
    color:#FFF;
    background-color:#808080;
    padding:18px;
    font-weight:normal;
    text-decoration: none;

}


#login_links .forgot a:hover {
    text-decoration: underline;

}

#login label {
    width:6em;
    display: block;
    text-align: left;
    /*float: left;*/
    line-height: 25px;
    margin-left: 22px;

}

#page_mydetails .recordset {
    width:48%;
}

.recordset h4 {
    font-size:11px;
    background-image:url(../imgs/table_bg.gif);
    background-color:#535c66;
    color:#fff;
    border-bottom:1px solid #FFFFFF;
    padding:9px;
}

.highlight {
    background-color:#f7b100;
    color:#000;
}

.highlight a, .highlight a:visited {
    color:#000;
}

#nav a:hover, #nav .active a {
    color:#f7b100;
}

#loginpage #content {
    padding-top:18px;

}