关于<span>标签在css中的实现中遇到的问题
我在一个html文档中对<span>和<h1>这两个标签加入了相同的css样式,但为什么被<span>作用的内容不能居中,而被<h1>标签作用的内容可以?以下是我写的代码,请各位大神指点一下,谢谢!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<style type="text/css">
h1
{
font-size:50px;
color:blue;
text-align:center;
}
</style>
<!--此为css样式-->
<style type="text/css">
span
{
font-size:50px;
color:blue;
text-align:center;
}
</style>
<title>慕课网</title>
</head>
<body>
<h1>蓝色居中</h1>
<span>蓝色居中</span>
</body>
</html>