2014-02-27 38 views
0

我做了一個小登錄按鈕,但不幸的是,在寬度和顏色之前加載過渡會產生醜陋的效果。過渡之前的加載樣式?

這裏是我使用的代碼:

#login fieldset input[type="submit"] { 
    background-color: #1abc9c; 
    color: #fff; 
    display: block; 
    margin: 0 auto; 
    padding: 4px 0; 
    width: 100px; 
    border-radius: 0; 
    -webkit-transition: all 0.3s ease; 
    -moz-transition: all 0.3s ease; 
    -ms-transition: all 0.3s ease; 
    -o-transition: all 0.3s ease; 
    transition: all 0.3s ease; 
} 
+0

'transition'轉變_from_一個值_to_另一個。您的發佈代碼只顯示「原始」(_from_)值。你如何應用「過渡」(_to_)值? – Passerby

+0

@Passerby我正在使用這個值:'#login fieldset input [type =「submit」]:hover { \t background-color:#16a085; } \t' – Mee

+0

轉換看起來很好:http://jsfiddle.net/9zDUv/ – Passerby

回答

0

試試看

#login fieldset input[type="submit"] { 
    background-color: #1abc9c; 
color: #fff; 
display: block; 
margin: 0 auto; 
padding: 4px 0; 
width: 100px; 
    border-radius: 0; 
-webkit-transition: all 0.5s linear; 
-moz-transition: all 0.5s linear; 
-ms-transition: all 0.5s linear; 
-o-transition: all 0.5s linear; 
transition: all 0.5s linear; 

} 
#login fieldset input[type="submit"]:hover{ background-color:#F00;}