老师帮我看下是否正确

来源:4-3 编程练习

豆包侠

2021-08-23 09:56:46

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{
margin: 0;
padding: 0;
}

.beijing{
width: auto;
height: 4200px;
background: url(http://climg.mukewang.com/59c9f7ce0001839219034033.png)no-repeat center top;

}

.qianduan01{
width: 224px;
height: 364px;
position: fixed;
right: 0;
top: 50%;
margin-top: -200px;

}
.qianduan02{
width: 224px;
height: 364px;
position: fixed;
top: 50%;
left: 0;
margin-top: -200px;


}


</style>
</head>
<body>
<div class="beijing">
<div class="qianduan01">
<img src="http://climg.mukewang.com/5a3383c70001f1b702240364.png" >
</div>
<div class="qianduan02">
<img src="http://climg.mukewang.com/5a3383d00001a3dd02240364.png" >
</div>
</div>
</body>
</html>


写回答

1回答

好帮手慕然然

2021-08-23

同学你好,建议左右两个广告块垂直居中显示:实现绝对垂直居中,margin-top应设为高度的负一半,如图所示

http://img.mukewang.com/climg/612311d109e18a9309080494.jpg

祝学习愉快!

0

0 学习 · 40143 问题

查看课程