老师,这样可以吗 有个问题
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>4-3练习</title>
<style type="text/css">
html {
/*overflow-x:hidden;*/
/*overflow-y:hidden;*/
}
* {
margin: 0px;
padding: 0px;
overflow-y: hidden;
}
.container {
width: 100%;
height: 4000px;
z-index: 1;
position: absolute;
background: url("http://img1.sycdn.imooc.com/climg//59c9f7ce0001839219034033.png") center no-repeat ;
}
.nav_left img {
width: 200px;
height: 300px;
position: fixed;
left:0;
top:50%;
z-index: 9999;
margin-top:-150px;
}
.nav_right img {
width: 200px;
height: 300px;
position: fixed;
right:0;
top:50%;
z-index: 9999;
margin-top:-150px;
}
</style>
</head>
<body>
<div class="container" >
<!-- <div class="background">
</div> -->
<div class="nav_left">
<img src="http://img1.sycdn.imooc.com/climg//5a3383d00001a3dd02240364.png" alt="nav_left">
</div>
<div class="nav_right">
<img src="http://img1.sycdn.imooc.com/climg//5a3383c70001f1b702240364.png" alt="nav_left">
</div>
</div>
</body>
</html>
因为右边滚动条的出现,所以右边定位的图片width的距离看起来缩短一点,所以我加了overflow-y: hidden;这个样式,但是滚动条消失,随之鼠标也不能对网页滚动。
如何把滚动条隐藏,但又不对滚动条功能失效
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星