css - 为按钮聚焦状态(按钮:焦点)播放动画时文本跳转
问题描述
我的按钮聚焦状态有一个关键帧动画。问题是当按钮进入焦点状态时,动画开始播放并且该动画导致按钮文本的奇怪跳跃。
如何防止文本这种奇怪的摇晃和跳跃行为。
谢谢 !
.btn-inline {
border: none;
color: #eb2f64;
font-size: inherit;
border-bottom: 1px solid currentColor;
padding-bottom: 2px;
display: inline-block;
background-color: transparent;
cursor: pointer;
transition: all .2s;
}
.btn-inline:hover {
color: #333333;
}
.btn-inline:focus {
outline: none;
animation: Pulsate 1s infinite;
}
@keyframes Pulsate {
0% {
transform: scale(1);
box-shadow: none;
}
50%{
transform: scale(1.05);
box-shadow: 0 1rem 4rem rgba(0, 0, 0, .25);
}
100%{
transform: scale(1);
box-shadow: none;
}
}
<button class="btn-inline">Albufeira, Portugal</button>
解决方案
推荐阅读
- java - 如何动态处理两个布局android
- javascript - 如何打开 .eml 文件而不是使用 javascript 下载
- c# - Collection DropdownList 在渲染视图时失去其价值 - Asp.net MVC
- oracle - SET_ROWID_THRESHOLD - ORA-29971
- flutter - Flutter Syncfusion 范围指针 SweepGradient 渐变颜色
- java - 在使用 this 作为形式参数的情况下,无法在实际参数中传递对象的引用变量
- python - 由于来自另一个 pandas 列的值,从作为 datetime 列的时间差(以分钟为单位)
- java - Spring Boot 测试:@Scheduled bean 在脏上下文后继续执行
- jestjs - 开玩笑错误:无法设置基本提供程序。使用 'ng test' 升级 Angular v13 后
- email - 关于 Haveibeenpwned 中的域搜索的问题