img element:
Use percentage for width;
Can we use css control to achieve:
No matter what device it is on:
The height of img is always equal to the width
ringa_lee2017-06-28 09:28:36
Just let img
occupy the parent container of equal width and height. There are various postures. For example:
Link description
三叔2017-06-28 09:28:36
It’s okay to use the image as a background image, set height to 0 and padding-top to 100%.