xxxxxxxxxx
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>大卫编程网(div.cn)</title>
</head>
<body>
<center>This text will be centered.
<p>So will this paragraph.</p></center>
<div style="text-align:center">This text will be centered.
<p>So will this paragraph.</p></div>
注意:向 div 或者 p 元素应用 text-align:center 会使这些元素的内容居中,同时保留其整体大小不变。
</body>
</html>