2017-11-17 8 views
-5

午後、なぜCSS属性-webkit-transition: all .8s ease-in-out;がそれを想定していないのですか?WebkitトランジションがEdgeブラウザで動作しない

ブラウザはMS Edgeですが、私のコードは以下のとおりです。

おかげ

トッド

.callToActionDefault:hover { 
 
    color: white; 
 
    text-decoration: none; 
 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #0d89ca), color-stop(100%, #0d89ca)); 
 
    background: -webkit-linear-gradient(top, #0d89ca 20%, #0d89ca 100%); 
 
    background: linear-gradient(to bottom, #0d89ca 20%, #0d89ca 100%); 
 
} 
 

 
.callToActionDefault { 
 
    padding: 8px; 
 
    font-size: 15px; 
 
    margin-top: 20px; 
 
    letter-spacing: 0.5px; 
 
    color: white; 
 
    width: 60%; 
 
    display: block; 
 
    position: relative; 
 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #219cdd), color-stop(100%, #0d89ca)); 
 
    background: -webkit-linear-gradient(top, #219cdd 20%, #0d89ca 100%); 
 
    background: linear-gradient(to bottom, #219cdd 20%, #0d89ca 100%); 
 
    bottom: 0; 
 
    font-weight: 700; 
 
    -webkit-transition: all .8s ease-in-out; 
 
}
<a class="callToActionDefault" href="#">This is a button</a>

+1

:新旧のブラウザは次のコードを使用して、最大の互換性を達成するために

。 Edgeは 'webkit'を使用しません。接頭辞なしで 'transition'を使用してください。 Link to more - > http://shouldiprefix.com/#transitions – sol

答えて

2

EdgeはWebkitのベースのブラウザではありませんので、動作しません。 -webkit-接頭辞は、Google Chromeのような古いWebkitベースのブラウザの機能です。 `webkit`プレフィックスが` webkit`ブラウザのために働く

-webkit-transition: all .8s ease-in-out; // Old Chrome, Safari 
-moz-transition: all .8s ease-in-out;  // Old Firefox 
-ms-transition: all .8s ease-in-out;  // Internet Explorer 
-o-transition: all .8s ease-in-out;  // Old Opera 
transition: all .8s ease-in-out;   // Newer Browsers 
+0

ありがとう、間違いなく別の "問題"があるだろうが、それの地獄のために、それを試すことができます。 – user8709679

+0

ようこそ@ user8709679私が回答に含める完全なコードを使用すると、CSSトランジションをサポートするすべてのブラウザでトランジションが動作します。 –

+0

OK、はい 'background-color'属性では完全に動作しますが、CSSに対する' background'と 'linear-gradient'属性は完全に動作しません。ありがとうございました – user8709679

関連する問題