Solve the problem that phpcms images are too large to break through the form Image Adaptive Image scale down proportionally,

Source: Internet
Author: User

Solve the problem that phpcms images are too large to break through the form Image Adaptive Image scale down proportionally,
Img, a img {border: 0; margin: 0; padding: 0; max-width: 590px; width: expression (this. width590? 590px: this. width); max-height: 590px; height: expression (this. height590? 590px: this. height);} The above css code will have two problems! 1. The image will be changed to very img, a img {
Border: 0;
Margin: 0;
Padding: 0;
Max-width: 590px;
Width: expression (this. width & gt; 590? "590px": this. width );
Max-height: 590px;
Height: expression (this. height> 590? "590px": this. height );
}

The above code has two problems!
1. The image will be very small. You need to refresh the page to display it properly!
2. The image will not be scaled down proportionally, and the image will be severely deformed!
Modify as follows:



<! -- Begin CSS controls the image size 09.1.15 -->
<Style type = "text/css">
<! --
Img, a img {
Border: 0;
Margin: 0;
Padding: 0;
Max-width: pixel PX;
Width: expression (this. width> 650 & this. width> this. height? Pixel Px: 'auto ';);
Max-height: 1650px;
Height: expresion (this. height> 1650? 1650px: 'auto ';);
} -->
</Style>
<! -- End CSS controls the image size 09.1.15 -->

Place the above Code between

Related Article

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.