MAX width and max height of a image using css
I am made a file web page where i am using css code for uplaoding any images.I am having a doubt regarding one thing, is there any way which we can for an image where we can set some condition where image cannot go beyond that height and width.I have heard that we can do it by using max height and max width but don't know how to use this.
Re: css max image width proportions
For making some restriction on image height and width in Opera, Internet Explorer and other browser you can use the following code in css.
Code:
#frontpage img {
max-width: 200px;
max-height: 200px;
}
#gallery img {
max-width: 500px;
max-height: 500px;
}
Re: How to MAX width and height of a image using css
Try to put it inside a div with a set width and height and set overflow: none do the following this in CSS file, now dimensions of image are proportional & constrain and they set by default.