老师您看下,怎么能让背景图尺寸和浏览器视口尺寸一样

来源: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回答

好帮手慕码

2019-11-22

同学你好,请问是说出现了横向滚动条是吗?可以设置如下:

http://img.mukewang.com/climg/5dd744e509ee077a02270101.jpg

如果我的回答帮到了你,欢迎采纳,祝学习愉快~

0
hulilili
h 就是慕课的页面宽度比视口宽度要宽,怎么等比例缩小到我自己电脑的视口尺寸?
h019-11-22
共1条回复

0 学习 · 40143 问题

查看课程