簡體   English   中英

我的表單上的CSS樣式在Firefox上不起作用

[英]CSS-styling on my form doesn't work on Firefox

我有此登錄表單,該表單可以正常運行,並且在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

我刪除了浮標(帶有錯字),在.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中使用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM