CSS Horizontal and Vertical Centering

By |Monday, May 22, 2017|CSSwarriors|

We’ve all seen margin: 0 auto; for horizontal centering, but margin: auto; has refused to work for vertical centering… until now!

But there are certain ways by which you can achieve it without any fuss!

1. Flexbox


.v-center-flex {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - [...]

CSS Advanced Selectors

By |Friday, May 19, 2017|CSSwarriors|

These days, if you assign IDs to elements only so you can style them, you are probably doing it wrong. CSS 2.1 and CSS 3 introduced a number of powerful selectors that can make your layouts cleaner, and your stylesheets more awesome.

These are supported in all major browsers including IE9 and up.


/* Selectors for matching the first [...]

CSS Counters

By |Friday, May 19, 2017|CSSwarriors|

Using counters

To use a CSS counter, it must first be reset to a value (0 by default). To add the value of a counter to an element, use the counter() function. The following CSS adds to the beginning of each element “Section:”.


body {