Vertical Centering with a Shiv Div

Matthew Tretter has solved the perennial problem with the current vertical centering technique – loss of content vertically when the window is too small, without even scrollbars to see that lost content. His simple solution is the addition of a floated ‘shiv div’ that sits at the top, pushing the main content area down, but then collapses when the content arrives at the top of the screen.

This shiv div could also serve other purposes, such as container for skip links, although the addition of a simple little div doesn’t cause me any sleepless nights.

Before I leave the subject of vertical centering, a wee tip. Instead of making the negative margin exactly half the height of the main content, give it 10px more. Its a picture framing trick, as centering it exactly can make it feel as if it’s ‘falling off the page’.

I’m going to implement this genius fix as soon as I can, although the semi-fluid design I desire ( I don’t intend the site to be stuck at 900px wide) still eludes me.

The Hickensian is the journal of Jon Hicks, one half of the creative partnership Hicksdesign. Take a look at the work we do.

AD by FUSION

Upcoming Talks

I sometimes pop up at conferences and waffle about design, icon creation in particular. Here's where I'll be next:

An Event Apart Chicago- "Icon Design Process" - 25-26th August 2014

Web Expo Guildford- "Icon Design Process" - 26th September 2014

Beyond Tellerrand Berlin – 3rd-5th November 2014

playlist

See more on last.fm

Contact

Hicks

73a High Street

Witney

Oxfordshire, UK

OX28 6JA

+44 (0)7917 391 536

Download vCard

Engine Room:

Hicksdesign is powered by Textpattern and hosted by the lovely boffins at Engine Hosting

Engine Hosting