请问老师这样写可以吗?
来源:6-3 编程练习
			_Crush_
2020-03-15 11:03:45
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding:0;
    }
    .test{
     width: 800px;
     height: 100px;
     background: red;
     /*此处写代码*/
     position:fixed;
     top:0px;
     left:50%;
     margin-left:-400px;
   
   }
   .out{
    width: 100%;
    height: 2000px;
    background-color: #abcdef;
  }
</style>
</head>
<body>
  <div class="out">
    <div class="test"></div>
  </div>
</body>
</html>1回答
同学你好,代码完成的不错,继续努力!
如果我的回答解决了你的疑惑,请采纳!祝学习愉快!
相似问题