I'm up against the centering deficiencies of current CSS. Building a Category page to display a series of products on a dynamically generated eCommerce site. I know that the upper limits of the thumbnail height and width are 140px, so every thumb will be 140 pixels in one dimension. But each product naturally has its own aspect ratio. So a picture of an upright vacuum will likely be 140 pixels high while a Rhomba would be 140 pixels wide but just a few pixels high.
Must I go through writing software to measure image height and write a local style setting the top and bottom margin; or is there some CSS trick that would make Margin: auto; actually work to center vertically and horizontally?
Bookmarks