Possible duplicate:
The vertical center of the HTML element within the dynamic height div
I am currently developing a website for which I need to focus some content vertically. The design is pretty simple: a fixed height header (aligned to the left and always at the top of the page), and also under vertically centered images in a horizontal line (yes, horizontal scrolling, I know).
Ideally, I would like the vertical centering of the images based on the 100% height of the viewport — the heading (so that the dynamic height that prevents the content of the heading from overlapping).
An example website can be found at http://bit.ly/vl1XNY , which currently uses tables for layout. Used css and html I can also find there (of course).
I am aware of various solutions for centering the content vertically inside a container with a fixed height, but none of them worked for me because I use variable height and do not want to use absolute positioning (to prevent a match). I looked around and tried the table-cell solution, line-height and absolute positioning.
So far, the only solution that worked exactly as I expected was to use tables. But I would like to refrain from using them. Does anyone know of a valid css and html solution for this problem? Or at least a more elegant solution?
user1059636
source share