0

I am trying to put together an application, and in the header for this application i have a table with 3 columns, one is the application logo, one is some text with the application title, and the third column is to dispay the users company logo by looking up which company they are assigned to...This all works just fine...

However the problem I am having is that images can look a bit distorted because i am using img height=90px width=90px src...

Is there anyway i can change this so that the height is 90px and the width is a proportional scale % to keep the image looking correct...

j08691
  • 204,283
  • 31
  • 260
  • 272
user3169979
  • 47
  • 1
  • 7
  • possible duplicate of [Resize image proportionally with CSS?](http://stackoverflow.com/questions/787839/resize-image-proportionally-with-css) – James Montagne May 28 '14 at 17:00

2 Answers2

3

Just set the height to 90px (and don't set the width). By default the browser will maintain the image proportions unless you set the width.

j08691
  • 204,283
  • 31
  • 260
  • 272
  • 1
    Its worth noting too that setting a min-max height and no width will allow for scaling between window sizes if that is a problem you're trying to accomplish. – Jem May 28 '14 at 16:58
0

thanks, that was a good answer, i actually found something else about 20 seconds after posting which has worked great...

img style="max-width: 100px; height: auto; " src="image.jpg

user3169979
  • 47
  • 1
  • 7