老师帮忙看一下代码
来源:3-12 编程练习
weibo__没趣味_03683219
2021-05-28 19:31:08
相关代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0;
padding:0;
}
.background {
width: 100%;
height: 100%;
}
.left {
width: 224px;
height: 364px;
position: fixed;
top: 50%;
margin-top: -182px;
left: 0px;
}
.right {
width: 224px;
height: 364px;
position: fixed;
top: 50%;
margin-top: -182px;
right: 0px;
}
</style>
</head>
<body>
<div class="background">
<img src="http://climg.mukewang.com/59c9f7ce0001839219034033.png" alt="">
</div>
<div class="left">
<img src="http://climg.mukewang.com/5a3383c70001f1b702240364.png" alt="">
</div>
<div class="right">
<img src="http://climg.mukewang.com/5a3383d00001a3dd02240364.png" alt="">
</div>
</body>
</html>
1回答
同学你好,代码实现效果很正确,建议优化一下css代码:将相同样式合并书写,可减少代码冗余,参考如下:
祝学习愉快!
相似问题