老师麻烦看下是否正确
来源:2-5 编程练习
坚持坚持再继续
2019-08-08 16:46:36
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS布局</title>
<style type="text/css">
.box{
width: 500px;
height: 200px;
margin:0 auto;
border:1px solid #aaa;
background-color: #ababab;
color: #fff;
font-weight: bolder;
position: relative;
}
.box div{
width: 200px;
height: 40px;
font-size: 16px;
text-align: center;
/*此处写代码*/
position:absolute;
top:100px;
left:250px;
margin-left:-100px;
margin-top:-20px;
}
</style>
</head>
<body>
<div class="box">
<div>
欢迎大家来到慕课网学习!
来到慕课网学习!
</div>
</div>
</body>
</html>
1回答
同学你好,实现效果没有问题,继续加油!欢迎采纳。
祝学习愉快!
相似问题