HTML文档内容:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>轮播</title>
<link rel="stylesheet" href="css/css.css" />
</head>
<body>
<div class="main">
<!--图片轮播-->
<div class="banner">
<a href="">
<div class="banner-slide" slide1></div>
</a>
<a href="">
<div class="banner-slide" slide2></div>
</a>
<a href="">
<div class="banner-slide" slide3></div>
</a>
</div>
</div>
</body>
</html>
css文档内容:
.main{
width: 1200px;
height: 460px;
margin: 30px auto;
overflow: hidden; <!--溢出隐藏-->
}
.banner{
width: 1200px;
height: 460px;
}
.banner-slide{
width: 1200px;
height: 460px;
background-repeat: no-repeat; <!--- 不要平铺--->
}
.slide1{
background-image: url("../images/pic1.jpg");
}
路径图:
- 4 回答
- 0 关注
- 2435 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消