老师帮我看一下代码是否正确
来源:3-11 编程练习
dy12369
2021-09-02 16:28:23
<!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:0;
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回答
好帮手慕然然
2021-09-02
同学你好,代码实现效果很正确,继续加油,祝学习愉快!
相似问题