У меня есть страница входа, которая, кажется, работает нормально в хром, хром (windows), сафари и firefox, но когда я тестирую его в IE. Кажется, что существует огромный разрыв между регистрационными полями и ссылкой "забытое имя пользователя или пароль". Я понятия не имею, почему это так, может кто-нибудь помочь мне решить эту проблему?
HTML:
<body id="loginpage">
<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>
<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>
</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>
</td>
</tr>
</tbody>
</table>
CSS:
#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;
}
.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 #submit_button {
display:block;
position:relative;
top:-48px;
right:10px;
}
#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;
}
#ie6 #login_form {
margin-bottom:-47px;
}
#ie6 #submit_button {
position:relative;
top:-4px;
}
#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;
}
#loginpage #content {
padding-top:18px;
}
Я исправил его, чтобы он выглядел хорошо в Chrome. Смотрите эту скрипку.
Я переместил все в div_ login и удалил любую позицию: relative; материал из CSS. Я понятия не имею, почему что-то использовало позицию: relative; так как он просто испортил макет.
Попытайтесь не переоценивать позицию: относительные и другие значения позиционирования, за исключением статического значения, которое является значением по умолчанию. Другой старый совет - не использовать таблицы для макета.
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>
CSS:
#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;
}
</div>
красным цветом. В целом ваш HTML очень нечитаемый, я не знаю, ТАКОЕ ли это форматирование или вы пишете так. Попробуйте запустить ваш HTML через этот валидатор. validator.w3.org