老师您看下,怎么能让背景图尺寸和浏览器视口尺寸一样
来源:4-2 侧边栏导航跟随案例
zulilili
2019-11-21 23:49:50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
.body{margin:0;
padding:0;}
.page{background:center no-repeat;
width:100%;
height:100%;
margin:0 auto}
.left{position:fixed;
top:50%;
bottom:50%;
left:0;
width:224px;
height:364px;
margin:auto auto;}
.right{position:fixed;
top:50%;
bottom:50%;
right:0;
width:224px;
height:364px;
margin:auto auto;}
</style>
</head>
<body>
<div class="page"><img src="http://climg.mukewang.com/59c9f7ce0001839219034033.png">
<div class="left"><img src="http://climg.mukewang.com/5a3383c70001f1b702240364.png"></div>
<div class="right"><img src="http://climg.mukewang.com/5a3383d00001a3dd02240364.png"></div>
</div>
</body>
</html>
1回答
同学你好,请问是说出现了横向滚动条是吗?可以设置如下:
如果我的回答帮到了你,欢迎采纳,祝学习愉快~
相似问题