BigDDunc
08-23-2007, 03:18 AM
Is there anyway to limit the size of images (dimensions) via CSS?
I have looked at this example:
http://www.bigbaer.com/css_tutorials/css.scale.image.html.tutorial.htm
And although it does achive what I need partly by reducing the size of the said image, I need something along the lines of max-height max-width.
As images could be 100 x 100 or 2000 x 2000 and I want them to be <400 x <400 so any images greater then 400x400 would be resized to those dimensions.
Is this possible in CSS?
***EDIT***
Was answered, for others looking the following css:
#maxsize {
max-width:700px;
width: expression(this.width > 700 ? 700: true);
}
the width: expression is a hack for IE6.
I have looked at this example:
http://www.bigbaer.com/css_tutorials/css.scale.image.html.tutorial.htm
And although it does achive what I need partly by reducing the size of the said image, I need something along the lines of max-height max-width.
As images could be 100 x 100 or 2000 x 2000 and I want them to be <400 x <400 so any images greater then 400x400 would be resized to those dimensions.
Is this possible in CSS?
***EDIT***
Was answered, for others looking the following css:
#maxsize {
max-width:700px;
width: expression(this.width > 700 ? 700: true);
}
the width: expression is a hack for IE6.