单行文字水平居中 div{ width: 400px; height: 400px; border: 1px solid black; /*水平居中*/ text-align:center; /*单行垂直居中*/ line-height: 400px;