Centering (horizontally and vertically) an image in a box

in Blog This article was originally published by Julian Seery Gude on The Remarkable Blog from exceler8.com
<div class="posterous_bookmarklet_entry">
  <blockquote class="posterous_long_quote"><h1>Centering (horizontally and vertically) an image in a box</h1>

The problem

We want to center an image inside a container, bigger than the image and with assigned dimensions. The image is not a background one, it’s a true <img> element.

Any image has well defined dimensions, so the easiest and most reliable way to solve the problem is:

<p>If you work on websites then you come across some interesting challenges when formatting images in different sizes. I found this instructional article on brunildo.org (Italian) quite helpful. The url to Brunildo.org was left like a breadcrumb in the css of the WordPress NextGen Gallery plugin (well done Alex!). 

~julian

Via Alex Rabe WordPress NextGen Gallery Plugin

Comments are closed.