2016-08-02 7 views
0

이 로그인 양식은 Chrome, IE11 및 Edge에서 올바르게 작동하지만 Firefox에서 시험해 볼 때 완전히 다른 것처럼 보입니다.내 양식의 CSS 스타일링이 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="[email protected]" placeholder="اسم المستخدم" /> 
    </p> 

    <p> 
     <label for="loginform">كلمة المرور</label> 
     <input type="password" name="password" id="password" value="[email protected]" 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 확인할 수 있습니다.

+5

그냥 의견 : 당신의 CSS에 여러 번 float : right;'float : rihgt;이 있습니다 – wasthishelpful

+0

정확히 firefox (ver 47)에서 chrome과 동일한 레이아웃을 얻습니다 모든 애드온으로 다시 시도하십시오 사용할 수 없습니다. – RDardelet

+0

firefox & chrome on the same :-) –

답변

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%; 
    } 
} 

사파리와 파이어 폭스 모두에서 작동하는 것 같다.

관련 문제