3 min readCSS3
CSS vertical centering techniques
So what is the best way to center blocks vertically using CSS? There are bunch of techniques, lets try each of them! 1. “line-height” property HTML code: <div class="outer-block"> <div class="inner-block"> <p>Some text</p> <p>Some more text</p> </div> </div> CSS code: .outer-block { height: 200px; line-height: 200px; text-align: center; } .inner-block { display: inline-block; line-height: 1.5; text-align: left; … Continue reading CSS vertical centering techniques