div里面的span标签为什么不能居中

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
<!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>

我想说的是垂直怎么不是居中

.main span{
            display: block;
            line-height: 20px;
            background-color: rebeccapurple;
        }

在.main加个文本居中 text-align: center;


.main {
        margin: 100px auto;
        height: 20px;
        width: 300px;
        background-color: aquamarine;
        text-align: center;
}

是居中的,你看到会向下塌一点是吗,这是因为inline-block会自动产生边距