老师请帮我检查一下代码正确性,谢谢你辛苦啦~~
来源:4-3 编程练习
慕后端1196960
2019-12-31 01:11:50
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>mooc</title>
<style type="text/css">
.mooc{
background:url("http://climg.mukewang.com/59c9f7ce0001839219034033.png");
width:100%;
height:4033px;
position: relative;
}
.web{
background:url("http://climg.mukewang.com/5a3383d00001a3dd02240364.png");
height:364px;
width:224px;
float:left;
position: fixed;
top:50%;
left:0;
margin-top: -100px;
}
.java{
background:url("http://climg.mukewang.com/5a3383c70001f1b702240364.png");
height:364px;
width:224px;
float:right;
top:50%;
margin-top: -100px;
right:0;
position: fixed;
}
</style>
</head>
<body>
<div class="mooc">
<div class="web"></div>
<div class="java"></div>
</div>
</body>
</html>
1回答
好帮手慕慕子
2019-12-31
同学你好, 左右侧内容垂直居中存在误差,建议:调整margin-top负值为自身高度的一半。
如果我的回答帮助到了你,欢迎采纳,祝学习愉快~
相似问题