麻烦老师帮忙检查下
来源:4-3 编程练习
学习plus
2020-03-26 21:02:55
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
.content{
width: 100%;
height: 4000px;
background: url("http://climg.mukewang.com/59c9f7ce0001839219034033.png") top center no-repeat;
}
.rtAd{
width: 240px;
height: 270px;
background: url("http://climg.mukewang.com/5a3383c70001f1b702240364.png");
position: fixed;
right: 0;
top: 0;
bottom: 0;
margin: auto 0;
}
.ltAd{
width: 240px;
height: 270px;
background: url("http://climg.mukewang.com/5a3383d00001a3dd02240364.png");
position: fixed;
left: 0;
top: 0;
bottom: 0;
margin: auto 0;
}
</style>
</head>
<body>
<div class="content">
<div class="ltAd"></div>
<div class="rtAd"></div>
</div>
</body>
</html>请问老师是否有需要改进的地方
1回答
同学你好,定位是没有问题的,需要优化的问题如下:
1. 建议同学将元素的默认margin和padding去除,否则body的默认样式margin会影响页面美观,如图:

建议添加如下样式:

2. 左右两侧块元素背景图片显示不完全,可以按照图片的尺寸设置块元素的宽高,修改如下:


如果我的回答帮到了你,欢迎采纳,祝学习愉快!
相似问题