How can I vertically align elements? I have an image gallery in which I want all images to be centered vertically and horizontally. The horizontal part is easy, but I can't figure out how to center vertically. Here are my styles:
#pictureWrapper { position:relative; background-color:#CCCCCC; height: 363px; width: 363px; } #mainpic { height: 320px; width: 320px; position:relative; margin:auto; } #mainpic img { margin:auto; display:block; } #mainpic is the first child of #pictureWrapper and I want it to be centered vertically. But I also need to have the #mainpic img vertically aligned too, because when the image is landscape oriented there is a huge amount of space below. Is it possible to align vertically? ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/