请老师看看代码有没有问题
来源:4-3 编程练习
幕布斯9455189
2019-02-25 15:07:19
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{
margin,
}
.box{
width:100%;
height:896px;
background:url('http://climg.mukewang.com/59c9f7ce0001839219034033.png') center top no-repeat;
}
.leftbox{
width:205px;
height:255px;
position:fixed;
top:50%;
left:0;
margin-top:-103px;
background:url('http://climg.mukewang.com/5a3383d00001a3dd02240364.png') no-repeat;
}
.rightbox{
width:205px;
height:255px;
position:fixed;
top:50%;
right:0;
margin-top:-103px;
background:url('http://climg.mukewang.com/5a3383c70001f1b702240364.png') no-repeat;
}
</style>
</head>
<body>
<div class="box">
<div class="leftbox"></div>
<div class="rightbox"></div>
</div>
</body>
</html>
1回答
同学你好,效果没有问题哦,不过老师建议背景图的高度建议设置大一点,让页面有上下滚动条出现,这样效果会好一点,如下:
可以试一试哦,如果帮助到了你,欢迎采纳。
祝学习愉快!
相似问题