css - 在伪元素上重新加载每个页面后,Z-index 会导致奇怪的重影效果
问题描述
目标
面临的问题
每次我重新加载页面时,都会出现这个黑色填充。(转换工作正常,但我想了解导致此问题的原因)我能够弄清楚这是由于 Z-index 属性
代码
按钮元素代码
#btn3{
position: relative;
transition: 0.5s ease-out;
z-index: 0;
}
#btn3::after{
content: '';
position: absolute;
width: 100%;
height: 0%;
background-color: orange;
bottom: 0;
left: 0;
z-index: -1;
transition: 0.5s ease-in-out;
border-radius: 10px;
}
#btn3:hover::after{
height: 100%;
}
解决方案
推荐阅读
- javascript - 防止用户在 Datepicker 文本框中输入无效的日期格式而不禁用它
- regex - perl中与“(”匹配的正则表达式
- c# - 202 访问 wcf 时接受
- react-native - 如何在物理Android手机中本地安装反应本机应用程序?
- powershell - 为删除从今天起超过一个月的 Exchange 共享邮箱电子邮件执行 Powershell
- azure-devops - 如何在 XML 策略文件中将 Azure API 后端设置为 Azure 资源?
- android - Android数据库计划
- java - 我是怎么得到这个答案的?
- android - Android资源编译失败-资源'attr/layout_anchorGravity'的重复值与配置
- c# - 是否可以仅回发特定工具?