a标签转为块级元素后为什么text-aling:center还起作用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
ul {
margin: 0px;
list-style: none;
}
a {
display: block;
background: #ccc;
color: black;
text-decoration: none;
padding-bottom: 3px;
width: 120px;
line-height: 30px;
text-align: center;
}
a:hover {
background: darkorange;
color: white;
}
</style>
</head>
<body>
<ul>
<li>
<a href="#">首 页</a>
</li>
<li>
<a href="#">新闻快讯</a>
</li>
<li>
<a href="#">产品展示</a>
</li>
<li>
<a href="#">售后服务</a>
</li>
<li>
<a href="#">联系我们</a>
</li>
</ul>
</body>
</html>