请问这样对吗?
来源:7-2 编程练习
calm__
2020-04-07 09:29:51
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.img1{
width: 100%;
position: relative;
z-index: 100;
}
.img2{
width: 250px;
height: 300px;
}
.img3{
width: 250px;
height: 300px;
}
.div2{
position: fixed;
left:100px;
top: 200px;
z-index: 200;
}
.div1{
position: fixed;
right: 100px;
top: 200px;
z-index: 200;
}
</style>
</head>
<body>
<div class="main">
<img src="http://climg.mukewang.com/59c9f7ce0001839219034033.png"class="img1">
<div class="div1">
<img src="http://climg.mukewang.com/5a3383c70001f1b702240364.png" class="img2">
</div>
<div class="div2">
<img src="http://climg.mukewang.com/5a3383d00001a3dd02240364.png" class="img3">
</div>
</div>
</body>
</html>
1回答
你好,代码是没有问题的,考察的重点固定定位也是正确的,为了效果和要求一样,建议:
left:100px;
right:100px;
改为:
left:10px;
right:10px;
效果如下:
如果解决您的问题请采纳,祝学习愉快!
相似问题