问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
.main{
margin: 100px auto;
height: 20px;
width: 300px;
background-color: aquamarine;
}
.main span{
display: inline-block;
line-height: 20px;
background-color: rebeccapurple;
}
</style>
</head>
<body>
<div class="main">
<span>我的地盘</span>
</div>
</body>
</html>