Skip to content

Category: CSS3

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

4 min readCSS32 comments

Image slider on pure CSS3

Recently I’ve read one article about slider without any JS code and I decided to extend this idea and here is what i’ve got. First, we will need basic HTML layout for slider: <ul class="css-slider"> <li><img src="slides/1.jpg" alt=""></li> <li><img src="slides/2.jpg" alt=""></li> <li><img src="slides/3.jpg" alt=""></li> <li><img src="slides/4.jpg" alt=""></li> <li><img src="slides/5.jpg" alt=""></li> </ul> Quite simple and straightforward. … Continue reading Image slider on pure CSS3