我有这个登录表单,在Chrome,IE11和Edge中运行起来很好但是在Firefox上试用时,它看起来完全不同;
我的标签宽度不一样,所以我必须重新调整它们。此外,我的提交按钮似乎没有采用样式。
我如何才能使用Firefox?
我的HTML:
<div class="loginheader">تسجيل الدخول</div>
<div class="loginform">
<form action="login.php" method="post" name="myform" id="myform">
<p>
<label for="loginform">اسم المستخدم</label>
<input type="text" name="username" id="login" value="mohammed.nasyia@gmail.com" placeholder="اسم المستخدم" />
</p>
<p>
<label for="loginform">كلمة المرور</label>
<input type="password" name="password" id="password" value="mohammed.nasyia@gmail.com" placeholder="كلمة المرور" />
</p>
<p >
<input type="submit" name="submit" value="تسجيل الدخول" class="button admin-login-button"/>
</p>
</form>
</div>
<div class="loginfooter">
<a href="#" class="examinee"> تسجيل الدخول كممتحن </a>
</div>
</div>
CSS:
.login-container {
margin-top: 100px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
width: 600px;
}
.loginform {
direction:RTL;
padding: 55px;
background-color: #fff;
border: 1px solid #eee;
border-bottom: 0px;
border-top: 0px;
}
.loginheader {
text-align: center;
background-color: #f5f5f5;
padding: 15px 0px;
border-radius: 10px 10px 0 0;
font-size: 30px;
}
.loginfooter {
padding: 15px 40px;
background-color: #f5f5f5;
border-radius: 0px 0px 10px 10px;
font-size: 18px;
text-align: center;
}
.loginheader, .loginfooter {
background-color: #f5f5f5;
border: 1px solid #ededed;
}
a {
text-decoration: none;
color: #000;
}
input[type=text], input[type=password] {
padding: 0 10px;
width: 320px;
height: 38px;
font-size: 16px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
}
label {
float: rihgt;
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.edit-examinee label{
float: rihgt;
width: 130px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.loginform label {
float: rihgt;
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.button {
display: inline-block;
zoom: 1;
padding: 12px 30px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font: bold 16px arial, helvetica, sans-serif;
text-decoration: none;
white-space: nowrap;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.admin-login-button {
margin-right: 350px;
color: #333;
background-color: #fff;
border-color: #ccc;
}
.admin-login-button:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.admin-login-button:active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
position: relative;
top: 2px;
text-shadow: none;
box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
}
您还可以查看表单的JSFiddle。
答案 0 :(得分:1)
我移除了浮点数(带有拼写错误),将边距设置为.admin-login-button
左侧。我还为较小的屏幕添加了媒体查询。
https://jsfiddle.net/6p4v9hs6/7/
新CSS:
.login-container {
margin-top: 100px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
width: 600px;
}
.loginform {
direction:RTL;
padding: 55px;
background-color: #fff;
border: 1px solid #eee;
border-bottom: 0px;
border-top: 0px;
}
.loginheader {
text-align: center;
background-color: #f5f5f5;
padding: 15px 0px;
border-radius: 10px 10px 0 0;
font-size: 30px;
}
.loginfooter {
padding: 15px 40px;
background-color: #f5f5f5;
border-radius: 0px 0px 10px 10px;
font-size: 18px;
text-align: center;
}
.loginheader, .loginfooter {
background-color: #f5f5f5;
border: 1px solid #ededed;
}
a {
text-decoration: none;
color: #000;
}
input[type=text], input[type=password] {
padding: 0 10px;
width: 320px;
height: 38px;
font-size: 16px;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
}
label {
/* float: rihgt; */
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.edit-examinee label{
/* float: rihgt; */
width: 130px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.loginform label {
/* float: rihgt; */
width: 100px;
line-height: 40px;
padding-left: 10px;
font-size: 18px;
text-align: left;
display: inline-block;
margin: 10px 0px;
}
.button {
display: inline-block;
zoom: 1;
padding: 12px 30px;
margin: 0;
cursor: pointer;
border: 1px solid #bbb;
overflow: visible;
font: bold 16px arial, helvetica, sans-serif;
text-decoration: none;
white-space: nowrap;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
.admin-login-button {
margin-left: 350px;
color: #333;
background-color: #fff;
border-color: #ccc;
}
.admin-login-button:hover {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
.admin-login-button:active {
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
position: relative;
top: 2px;
text-shadow: none;
box-shadow: 0 1px 1px rgba(0, 0, 0, .3) inset;
}
@media screen and (max-width: 540px) {
input[type=text], input[type=password] {
width: 90%;
}
}
似乎可以在Safari和Firefox中使用。