老师这样写可以吗

来源:7-2 编程练习

昵称加载中__

2019-09-18 13:18:50


<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

<title></title>

<style type="text/css">


.p0{position: relative;

height: 3000px;

width: 100%;


}

.p1{

position: fixed;


left:230px;

top: 30%;

}

    .p2{


     position: fixed;

     right: 230px;

     top: 30%;

    }


/*     img{

     height: 150px;

     

    } */


</style>


</head>

<body>

<div>


<div class="p0">


<img src="http://climg.mukewang.com/59c9f7ce0001839219034033.png">

</div>


<div class="p1">

<img src="http://climg.mukewang.com/5a3383c70001f1b702240364.png">

</div>


<div class="p2">


<img src="http://climg.mukewang.com/5a3383d00001a3dd02240364.png">

</div>


</div>



</body>

</html>


写回答

1回答

好帮手慕小尤

2019-09-18

同学你好,在本地运行代码,发现出现下滚动条。如图所示:

http://img.mukewang.com/climg/5d81c8ef09928c0318940228.jpg

建议同学为p0下的img设置宽度。代码如下:

.p0 img {
  width: 100%;
}

祝学习愉快!

0

0 学习 · 4928 问题

查看课程