html - CSS hover 效果移动不流畅

标签 html css twitter-bootstrap transactions transform

<分区>

正如我的标题所说,当我尝试将鼠标悬停在我的容器上时,它会立即放大,而不是从其原始大小平滑过渡。我在我的 CSS 中使用转换和过渡。

JS Fiddle 代码:https://jsfiddle.net/1kbtjaLs/

悬停效果:

  .card:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);

    -webkit-transform: all .3s ease-in-out time;
    -moz-transform: all .3s ease-in-out time;
    -ms-transform: all .3s ease-in-out time;
    -o-transform: all .3s ease-in-out time;
    transition: all .3s ease-in-out time;
  }

ease in out 似乎没有按预期运行。

1

最佳答案

请尝试下面的代码

CSS

 .card {
    width: 350px;
    transition: 0.5s all ease 0s;
    -webkit-transition: 0.5s all ease 0s;
    -moz-transition: 0.5s all ease 0s;
    -ms-transition: 0.5s all ease 0s;
}
.card:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
    transition: 0.5s all ease 0s;
    -webkit-transition: 0.5s all ease 0s;
    -moz-transition: 0.5s all ease 0s;
    -ms-transition: 0.5s all ease 0s;
}

关于html - CSS hover 效果移动不流畅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57156497/

上一篇:javascript - 在 PHP 包含的 header 上更改 CSS

下一篇:css - 我可以让 div 像按钮一样缩小到文本宽度吗?

相关文章:

javascript - Bootstrap 工具提示工作但由于 z-index 而隐藏?

html - 为什么我的 'store' 列表元素不是全部 float ?

带有 img 的 CSS 列标题 - 如何将 img/div 停靠在右侧?

html - 无法在 bootstrap knockout 网页中的下拉列表旁边显示文本

jquery - 使用 Toggle 时更改文本和按钮

html - 实现 css hover 以适用于所有 <a> 元素,其他元素之一

javascript - Bootstrap 折叠部分并通过一个按钮展开另一个部分

html - 容器内具有背景颜色的 Div 的宽度小于其容器

javascript - Internet Explorer 中的 CSS3 多列功能

html - 按钮与文本区域不在同一行