Middle horizontal text: text-align: center;
single text vertical center: line-height: the height of the box
Line-height: start from where the end of a line of text, the next line of text to the end of the local end
Case:
(1)html
<H1> This is the text </ h1>
(2)css
h1{
height: 150px;
border: 1px solid #000;
text-align: center;
line-height: 150px;
}