水平居中实现
text-align:center文本水平居中
a{
text-align: center;
}
初始
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
div{
width: 1200px;
height: 500px;
background-color: antiquewhite;
/* text-align: center; */
}
</style>
</head>
<body>
<div>
文本水平居中
</div>
</body>
</html>
加上文本居中
div{
width: 1200px;
height: 500px;
background-color: antiquewhite;
text-align: center;
}
<