这篇文章主要介绍了HTML如何实现网页盒子隐藏滑动效果的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇HTML如何实现网页盒子隐藏滑动效果文章都会有所收获,下面我们一起来看看吧。
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
ul,li{list-style: none;margin: 0;padding: 0;}
ul{
width: 900px;height: 220px;
margin: 50px auto;
}
ul li{
width: 200px;height: 200px;
border: 3px solid black;
float: left;
background: url(10课堂素材/01.jpg);
background-size: 200px;
position: relative;
overflow: hidden;
}
li:nth-child(2){
background: url(10课堂素材/02.jpg);
background-size: 200px;
}
li:nth-child(3){
background: url(10课堂素材/03.png);
background-size: 250px;
}
.li:nth-child(4){
background: url(10课堂素材/04.png);
background-size: 200px;
}
ul li hgroup{
width: 200px;height: 200px;
position: absolute;
top:220px;
left:0px;
background: rgba(255,255,255,0.5);
transition: all 2s;
}
ul li:hover hgroup{
display: block;
position: absolute;
top:0px;
left: 0px;
}
</style>
</head>
<body>
<ul>
<li>
<hgroup>
<p>waiting for you</p>
<h3>接下来</h3>
</hgroup>
</li>
<li>
<hgroup>
<p>waiting for you</p>
<h3>请欣赏</h3>
</hgroup>
</li>
<li>
<hgroup>
<p>waiting for you</p>
<h3>页面效果</h3>
</hgroup>
</li>
<li>
<hgroup>
<p>waiting for you</p>
<h3>滑动</h3>
</hgroup>
</li>
</ul>
</body>
</html>
关于“HTML如何实现网页盒子隐藏滑动效果”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“HTML如何实现网页盒子隐藏滑动效果”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注编程网行业资讯频道。