I need a way to size the DIV.container based on the size of the IMG - the IMG is meant to set the size. The IMG's sizing is supposed to be based on a percentage size with reference to the viewport. Also the width and/or the height of the IMG may be auto.
A simple css like so will do the job:
img {
width: 100%;
display: inline-block;
}
As far as size is concerned, just use one size. For example if width is larger than height then use width: 100%; If height is larger than width, use height: 100%; DON'T USE BOTH UNLESS YOU WANT TO MESS UP THE ASPECT RATIO.
With over 1.2 billion devices now running Windows 10, customer satisfaction is higher than any previous version of windows.
I need a way to size the DIV.container based on the size of the IMG - the IMG is meant to set the size. The IMG's sizing is supposed to be based on a percentage size with reference to the viewport. Also the width and/or the height of the IMG may be auto.
A simple css like so will do the job:
img {
width: 100%;
display: inline-block;
}
As far as size is concerned, just use one size. For example if width is larger than height then use width: 100%; If height is larger than width, use height: 100%; DON'T USE BOTH UNLESS YOU WANT TO MESS UP THE ASPECT RATIO.