zonderweb
5/3/2018 - 4:35 PM

From https://www.w3.org/Style/Examples/007/center.ru.html

div.container4 { 
height: 10em;
position: relative 
} 

div.container4 p {
margin: 0;     
background: yellow;     
position: absolute;     
top: 50%;     
left: 50%;     
margin-right: -50%;     
transform: translate(-50%, -50%) 
}