【发布时间】:2020-01-16 08:16:08
【问题描述】:
我创建了这个动画下划线,但底部似乎静止不动,而其他一切都在移动 - 使它看起来“滞后”
我创建了一个代码笔来说明这个问题。 你知道为什么会这样吗?
<!DOCTYPE html>
<html>
<body>
<span class="divider-body">
<div class="divider-wave" data-text="dividerdivider"></div>
</span>
</body>
</html>
<style type="text/css">
.divider-body {
display: flex;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
}
.divider-wave {
width: 30%;
height: 10%;
background: white;
overflow: hidden;
}
.divider-wave:before {
content: attr(data-text);
position: relative;
top: -42px;
color: white;
font-size: 4em;
text-decoration-style: wavy;
text-decoration-color: #607d8b;
text-decoration-line: underline;
animation: animate 0.5s linear infinite;
}
@keyframes animate
{
0%
{
left: 0;
}
100%
{
left: -30px;
}
}
</style>
【问题讨论】:
标签: html css animation text-decorations