CSS Vertical Align Div with CSS Table and Flexbox

Glenn Glenn's Blog 0 Comments

A straightforward approach with CSS Table This approach has been around for ages, but is still rarely used over absolute div positioning. We simply add CSS table to the parent div and table-cell to the child div to be centred:- [css] .vertical-container { display: table; } .vertically-centered { display: table-cell; vertical-align: middle; margin: auto; /* optional */ float: none; /* optional */ …

iPad Specific CSS Media Queries

Glenn Glenn's Blog 0 Comments

Here are the Media Queries for targeting your iPad in portrait or landscape mode:- [css] /* iPad in Landscape */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* CSS Styles */ } /* iPad in Portrait */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : …

Sequentially Number WordPress Posts

Glenn Glenn's Blog 0 Comments

With this WordPress Snippet you can add a Numerical Number to your WordPress Posts or Custom Posts. In this implementation we are creating a custom WordPress Loop and adding a sequential post number  1, 2, 3, 4 etc above the post title:- The numbering comes from the PHP variable ‘$postNumber’ and is automatically incremented on a post by post basis / …