css - 如何使图像幻灯片的叠加层向右显示在 css3 动画中的图像
问题描述
我正在用 CSS 制作页面加载器,我想显示带有向右滑动覆盖的徽标,例如加载栏,但这里想要制作加载徽标而不是栏。所以这是我的代码
.underlay{
width: 300px;
height:300px;
margin-left: 300px;
margin-top: 15%;
}
.underlay:before{
content:"";
width: 300px;
height:300px;
position: absolute;
top: 15%;
left: 300px;
z-index: 99;
background: rgba(0,0,0,0.9);
animation-name: slide;
}
<div class="outer">
<div class="underlay">
<img src="logo.png" alt="loading logo">
</div>
</div>
我希望把它滑到底层:在慢慢滑到右边之前
解决方案
@Ahtsham Ul Haq:试试这个代码,希望它对你有用!
.outer {
transition: all 0.3s linear;
}
.underlay img {
width: 300px;
height:300px;
display: block;
left: 10px
/* margin-left: 300px; */
/* margin-top: 15%; */
}
.underlay:before{
content: "";
width: 300px;
height: 300px;
position: absolute;
top: 10px;
/* left: 300px; */
z-index: 99;
background: rgba(0, 0, 0, 0.6);
transition: all 0.3s linear;
}
.outer:hover .underlay:before {
width: 0;
}
<div class="outer">
<div class="underlay">
<img src="https://i.ibb.co/8M3cFG4/bbb.jpg" alt="loading logo">
</div>
</div>
推荐阅读
- actions-on-google - 正在开发中为 Google Smart Home Action 定制徽标
- python - Ceph 与 Django
- apache-nifi - 使用 RouteOnAttribute 时出现问题(无法读取 json 属性并且总是将流发送到不匹配)
- bash - Shell:间接扩展会导致错误的替代我是 Windows 但不是 Mac
- powershell - Windows 7/PS2.0 New-Object System.Drawing.Text.PrivateFontCollection 不工作,但在 Windows 10 中工作
- python - 是否可以在 python 中为多个类属性定义一个通用的 setter 方法?
- python - BeautifulSoup Webscrape 问题
- python - pandas 基于链式拆分过滤数据帧
- php - laravel 6 没有观看查看子文件夹
- django - 如何从表单验证中排除字段但保存清理后的数据