Iamsamstimpson
Iamsamstimpson

Reputation: 1357

CSS: Variable Images (landscape/portrait) different dimensions.. need to centre in div container

I'm creating a video and image module for a website and am having trouble with how to deal with the image output, video's are fine because they come out after encoding the same dimensions... however images can be any dimensions and landscape or portrait.

so I made a little js fiddle template http://jsfiddle.net/t8RnL/ the paramiters are, the box container need to be the same height and width. The container needs to hold a landscape or portrait image within..

I need the image to be positioned in the centre...

has anyone got a suggestions, I'm at my wits end..

Upvotes: 0

Views: 4065

Answers (1)

techfoobar
techfoobar

Reputation: 66693

If all you need is centering the image in the DIV container, check this fiddle: http://jsfiddle.net/t8RnL/2/

Upvotes: 1

Related Questions