How does CSS set the maximum width of all images in a div. When an image is added to an article, the image is automatically scaled down proportionally.

Source: Internet
Author: User
# A2 IMG {max-width: 100px; max-Height: 100px;} (IE7 or later, FF ..) IE6 is only implemented using Js. First, you must determine which value of the image's width and height is relatively large, and then determine whether the value is beyond the DIV's range. If the value is exceeded, if you do not want to use JS, you have to sacrifice IE6 Div {width: 20px; Height: 20px; Border: solid 1px # F11; overflow: hidden ;} div IMG {max-width: 20px; max-Height: 20px; _ width: 20px; _ Height: 20px;} (set the image to a fixed size in IE6, images of other browsers are automatically adjusted)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.