CSS method to make the image change size with the screen: 1. Use the "width height auto" attribute to scale the image; 2. Use the "max-width max-height" attribute to set the maximum width and height.
The operating environment of this tutorial: windows7 system, css3 version, Dell G3 computer.
Recommended: "css Video Tutorial"
Sometimes we want the image to scale with the screen size, two situations:
Single picture scaling
Picture scaling within the box
Nude picture scaling
The picture is in a box
下面的文字
ps:
1. Use width height auto to zoom
2. Use max-width max-height to set the maximum width and height. 100% means the original maximum.
The above is the detailed content of How to make the image change size with the screen in css. For more information, please follow other related articles on the PHP Chinese website!