老师帮忙看下,谢谢!

来源:2-4 编程练习

weixin_慕码人1392209

2020-03-29 17:40:50

<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>2-4</title>
 <style type="text/css">
  *{
   margin: 0;
   padding:0;
  }
  .contanier{
   width: 380px;
   /*height: 240px; */
   margin: 0 auto;
  }
  .contanier .image{
   width: 380px;
   height: 240px;
  }
  .contanier .image img{
   width: 380px;
   height: 240px;
   display: block;
  }
  .contanier .topLayer{
   width: 380px;
   height: 240px;
   background-color: black;
   position: absolute;
   top: 0;
   opacity: 0.5;
   z-index: 1;
  }
 </style>
</head>
<body>
 <div class="contanier">
  <div class="image">
   <img src="http://climg.mukewang.com/58f829ca00010be703840240.jpg">
  </div>
  <div class="topLayer"></div>
 </div>
</body>
</html>


写回答

1回答

好帮手慕码

2020-03-29

同学你好,代码效果正确。继续加油,祝学习愉快~

0

0 学习 · 40143 问题

查看课程