背景图片显示问题
html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body>
<div class="main">
<div class="navigation">
<div class="banner">首页</div>
<div class="banner">点击看看</div>
<div class="banner">会自动的</div>
<div class="banner">我的网站</div>
</div>
<div class="imgs">
<div class="slide1 imgs-slide slide-active img"></div>
<div class="slide2 imgs-slide"></div>
<div class="slide3 imgs-slide"></div>
<div class="slide4 imgs-slide"></div>
</div>
</div>
</body>
</html>
css代码
*{
padding: 0;
margin: 0;
}
.main{
width: 1200px;
height: 480px;
margin: 30px auto;
position: relative;
}
/* 文字 */
.navigation{
width: 1200px;
height: 20px;
}
.banner{
width: 300px;
text-align: center;
background:gray;
float: left;
}
/* 图 */
.imgs{
width: 1200px;
height: 460px;
overflow: hidden;
}
.imgs-slide{
width: 1200px;
height: 460px;
float: left;
background-repeat: no-repeat;
}
.slide1{
background-image: url('../img/1.jpg');
}
.slide2{
background-image: url('../img/5.jpg');
}
.slide3{
background-image: url('../img/3.jpg');
}
.slide4{
background-image: url('../img/4.jpg');
}
老师图片的高度宽度都设置了路径也是对的
但是还是显示
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星