<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>逆水行舟不进则退</title>
</head>
<body>
<div style="height: 500px;font-size: medium;font-weight: bold;text-align: center;
line-height: 500px">66666</div>-->
<!--font-size设置字体大小-->
<!--font-weight设置字体粗细-->
<!--text-align: center;设置水平对齐-->
<!--height: 500px;设置整个div的高度-->
<!--line-height: 500px设置竖直方向对齐,这里的500必须与div的高度相同-->
</body>
</html>
执行以上代码,用浏览器打开,就可以看到这个666在中间的位置