CSS 3 - Scale transition snaps back in google chrome

与世无争的帅哥 提交于 2019-12-13 14:28:56

问题


I have an issue , I have the following code I am using for increasing the scale using CSS3 transition , at the end it snaps back to its original scale after increasing.

CSS:

.big{


        transition:all 0.3s ease-in-out;
        display:inline;
}
.big:hover{

-webkit-transform:scale(1.4);
}

HTML :

<h1 class = "big">Typo</h1>

回答1:


Try using inline-block instead of inline (also, it's recommended to add compatibility to the rest of the browsers as well).

CSS:

.big {
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    display: inline-block;
}
.big:hover {
    -webkit-transform: scale(1.4);
    -moz-transform: scale(1.4);
    -o-transform: scale(1.4);
    transform: scale(1.4);
}

HTML:

<h1 class="big">Typo</h1>

Test it here: http://jsfiddle.net/XbUC8/



来源:https://stackoverflow.com/questions/24834571/css-3-scale-transition-snaps-back-in-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!