The Hickensian
30.11.06 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.
Recent Posts
26.01.10 The Handbag has been raised!
22.01.10 Guide to the Internet (2000)
20.01.10 Designer, not a construction worker
19.01.10 Why you can never work 'full time'
16.01.10 Dream Report: Look at the Hygiene!
Or Full Archives
The Hickensian is the journal of Hicksdesign, a creative partnership of Jon & Leigh Hicks. Read more about us.
playlist
Hickr | RSS
Contact
Hicksdesign
Island House
Lower High Street
Burford
Oxfordshire, UK
OX18 4RR
+44 (0)7917 391 536
I am currently working full-time with Opera, and not taking on any new projects
No comments yet
Journal RSS Feed





Download vCard
Comments | RSS