脚本宝典收集整理的这篇文章主要介绍了纯CSS图片层叠点击展开,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
源码:抖音[代码女神]
图片:https://www.3dmgame.com/games/yuanshen/qrwtj_535/
<html>
<title>原神</title>
<head>
<style>
ul {
width: 1000px;
height: 500px;
margin: 100px auto;
}
li {
float: left;
height: 500px;
max-width: 710px;
/* border:1px solid gray; */
list-style: none;
}
ul :nth-child(1),
ul :nth-child(1) .bg {
background: url(https://img.3dmgame.com/uploads/images/news/20200119/1579416175_275268.jpg) center/cover;
}
ul :nth-child(2),
ul :nth-child(2) .bg {
background: url(https://img.3dmgame.com/uploads/images/news/20200119/1579417496_739273.jpg) center/cover;
}
ul :nth-child(3),
ul :nth-child(3) .bg {
background: url(https://img.3dmgame.com/uploads/images/news/20200119/1579416877_919906.jpg) center/cover;
}
ul :nth-child(4),
ul :nth-child(4) .bg {
background: url(https://img.3dmgame.com/uploads/images/news/20200119/1579418169_434972.jpg) center/cover;
}
ul :nth-child(5),
ul :nth-child(5) .bg {
background: url(https://img.3dmgame.com/uploads/images/news/20200915/1600137306_223576.jpg) center/cover;
}
input {
opacity: 0;
width: 50px;
height: 500px;
float: left;
overflow: hidden;
cursor: pointer;
transition: 0.5s;
}
input:checked {
width: 700px;
}
.bg {
opacity: 0;
position: absolute;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
z-index: -1;
filter:blur(5px);
}
input:checked ~ .bg {
opacity: 1;
}
</style>
</head>
<body>
<ul>
<li>
<input type="radio" name="switch" checked="checked">
<div class="bg"></div>
</li>
<li>
<input type="radio" name="switch">
<div class="bg"></div>
</li>
<li>
<input type="radio" name="switch">
<div class="bg"></div>
</li>
<li>
<input type="radio" name="switch">
<div class="bg"></div>
</li>
<li>
<input type="radio" name="switch">
<div class="bg"></div>
</li>
</ul>
</body>
</html>
以上是脚本宝典为你收集整理的纯CSS图片层叠点击展开全部内容,希望文章能够帮你解决纯CSS图片层叠点击展开所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。