div内内容文本水平居中

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>div居中</title>
<style>
.a{ 
  margin
:0 auto;
  width
:370px;
  border
:1px solid #000;
  text-align
:center
 } </style> </head> <body> <div class="a">div居中</div> </body> </html>
posted @ 2021-09-08 01:14  Sakimir  阅读(7)  评论(0)    收藏  举报