html - 在 CSS 中结合悬停和之后的部署动画
问题描述
我有一个用 HTML 和 CSS 创建的按钮,当悬停在它上面时会显示文本。我想要实现的是有一个过渡动画,因为我一直无法做到。
在 HTML 代码中,按钮与链接a 标签一起使用。
希望他们可以重新创建代码。我留下了一个网站链接,以便您可以完整地查看它:https ://policies.esims.one/terms (该按钮是第一个出现在页面上的按钮。)
.back-button{
font-weight: bold;
letter-spacing: normal;
line-height: 100%;
text-align: center;
text-decoration: none;
border-radius: 0px;box-shadow: none;padding: 5px 30px 5px 5px;
color: #181818;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
font-size: 12px;
}
.back-button::before{
margin-right:10px;
background-image:url(https://mcusercontent.com/ec104f3d77537e1962ab6441c/images/d7bb4928-a156-4682-9677-d0d5b47c3a21.png);
background-size:40px 40px;
display:inline-block;
width:40px;
height:40px;
border-radius:50%;
content:""
}
.back-button:hover:after{
content:"Home"
}
.mcnButton{
transition:.4s;
border-radius:50px!important;
box-shadow:#999 0 0 20px 0!important;outline:none;
user-select:none
}
.mcnButton:focus{
background:#eceff9!important;
color:#181818!important
}
<div style="display:flex;">
<a class="back-button mcnButton" href="https://www.example.com/" target="_self">
</a>
</div>
解决方案
您好,我尝试使用您的code
,如果您使用您的代码,它将完美运行:
<a class="back-button mcnButton" href="https://www.example.com/" target="_self"></a>
隐蔽为:
<a href="https://www.example.com/" target="_self">
<button class="back-button mcnButton"><button></a>
CSS也没有变化。
推荐阅读
- ios - 是否可以在 Web 和 iOS 应用程序之间共享会话?
- java - 我无法从 derby 包中导入 JDBC 客户端驱动程序
- python - Python:如何循环代码,以便一个接一个地从 csv 文件中提取列?
- pyspark - pyspark 中 addPyFile 的用法不明确
- tizen - Tizen 服务应用程序在未连接到 Tizen Studio 的情况下无法在后台正常运行
- javascript - 在派生类中使用 super 时出现错误
- ruby - 如何从数组中随机选择一个名称并检查它是否为大写
- function - 查找分配给学生 ID 号的多个分数的最大值
- java - java中的线程睡眠如何在内部工作?
- docker - GitLab 默认 autodevops CI:无效的标签名称