I have centered a lot of stuff in my webdevelopment career, but I was wondering if there is a simple way to centering an image vertically without knowing the image\'s dimens
You can use this:
#wrapper{ height: 100%; min-height: 500px;/*Assuming min-height of the container*/ position: relative; width: 100%;} #parent{ border: 1px solid; height: 50px; position: absolute; top: 50%; width: 50px;}
Check this in fiddle too http://jsfiddle.net/kYgqx/2/