HTML5   发布时间:2022-04-26  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了html5 – 清理CSS抖动大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我建立了这些圈子,当鼠标悬停时扩展边框.我现在遇到的唯一问题是圆圈会抖动/抖动.当我设置转换时,它变得更加明显:所有.1s轻松进出;超过.2s.

是否有解决这个问题的方法,或者只是它的方式?

这是JsFiddle中的代码

感谢您的帮助!

编辑:我正在转换圆的尺寸(宽度和高度)以保持居中.我意识到这会导致过渡期间的抖动.有工作吗?

解决方法

我摆脱了上/左定位的百分比值,清理了边距并对齐了外圈的边框宽度:

这是一个DEMO

.Box {
    position: relative;
    width: 220px;
    height: 220px;
    float: left;
    margin-right: 50px;
}

.clearcircle {
    position: absolute;
    top:15px;
    left:15px;
    width: 190px;
    height:190px;
    border-radius: 100%;
    background-color: transparent;
    border: 5px solid #c0392b;
    transition: all .2s ease-in-out;
}

.clearcircle:hover {
    width:220px;
    height: 220px;
    top: 0px;
    left: 0px;
    border: 5px solid #c0392b;

}
.circle {
    position: absolute;
    top:50%;
    margin-top: -100px;
    left: 50%;
    margin-left:-100px;
    width: 200px;
    height:200px;
    border-radius: 100%;
    background-color: #e74c3c;
    overflow: hidden;
    transition: all .2s ease-in-out;

}


.circle p {
    position:relative;
    text-align: center;
    top: 50%;
    margin-top: -55px;
    color: white;
    transition: all .3s;
}


.circle:hover{
    background-color: #e97468;
}

大佬总结

以上是大佬教程为你收集整理的html5 – 清理CSS抖动全部内容,希望文章能够帮你解决html5 – 清理CSS抖动所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: