老师,帮我检查一下了代码
来源:4-3 编程练习
慕虎0371676
2020-09-02 21:48:03
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin:0;
padding:0;
}
.bg{
width:1903px;
height:4033px;
text-align:center;
position:relative;
}
.bg .web{
width:224px;
height:364px;
position:fixed;
top:50%;
left:0;
margin-top:-182px;
}
.bg .java{
width:224px;
height:364px;
position:fixed;
top:50%;
right:0;
margin-top:-182px;
}
</style>
</head>
<body>
<div class="con">
<div class="bg"><img src="http://climg.mukewang.com/59c9f7ce0001839219034033.png" />
<div class="web"><img src="http://climg.mukewang.com/5a3383d00001a3dd02240364.png" /></div>
<div class="java"><img src="http://climg.mukewang.com/5a3383c70001f1b702240364.png" </div>
</div>
</div>
</body>
</html>
1回答
同学你好,效果实现了,代码中有两个细节需要注意下,如下:
1、如下所示位置,img标签缺少闭合标签>,建议添加上,让代码更加规范。
2、样式相同的代码,可以使用组合选择器写在一起,简化代码书写。示例:
如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
相似问题