How to realize the self-adaptation of picture width by css
This article mainly introduces css how to achieve self-adaptation of picture width, the article introduces in great detail, has a certain reference value, interested friends must read it!
Adaptive width of picture
How to make a larger picture automatically adapt to the width of a small container? CSS can write as follows:
The code is as follows:
Img {max-width: 100%}
However, IE6 does not support max-width, so when you encounter IE6, use IE conditional comments to rewrite the statement as follows:
The code is as follows:
Img {width: 100%} above are all the contents of the article "how to adapt the width of a picture by css". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!