【发布时间】:2022-01-31 21:51:22
【问题描述】:
我从教程中复制了这段代码,动画效果很好:
该按钮只是显示一个静态渐变。另外,我很难将文本垂直对齐到按钮的中心。例如。 top: 10px 实际上是按下按钮下方的文本。
.cta-button {
height: 32px;
border: 0;
padding: 0px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
font-weight: bold;
color: white;
text-justify: center;
}
.connect-wallet-button {
background-image: linear-gradient( to right, #ff8177 0%, #ff867a 0%, #000 21%, #f99185 52%, #cf556c 78%, #b12a5b 100%);
background-size: 200% 200%;
animation: gradient-animation 4s ease infinite;
}
<div class="connect-wallet-container">
<button class="cta-button connect-wallet-button">
Connect Wallet
</button>
</div>
【问题讨论】:
标签: html css css-animations