IE6 supports compatible min-width, Max-width CSS style properties

Source: Internet
Author: User

IE6 supports compatible min-width, Max-width CSS style properties

Let IE6 support Max-width, IE6 support min-width style (body music)

When we write CSS, often encounter let a picture or a layout can not exceed set a certain width range value, sometimes need to set a minimum width, followed by DIVCSS5 for everyone to summarize the solution IE6 does not support Min-width and max-width method is not supported. The following is the CSS width IE6 support minimum width, maximum width resolution technique (you may need to learn more about CSS width knowledge).

Directory

IE6 Support Max-width Solution
IE6 Support Min-width Solution
IE6 supports Max-width and supports min-width (body music)

1, IE6 support Max-width solution-TOP

IE6 supports maximum width and resolves CSS code:
. Yangshi{max-width:1000px;_width:expression ((document.documentelement.clientwidth| | document.body.clientWidth) <1000? " 1000px ":"); Overflow:hidden;}

Description: max-width:1000px; This is IE6. The maximum range width is supported by other brand browsers. and _width:expression ((document.documentelement.clientwidth| | document.body.clientWidth) <1000? " 1000px ":"); overflow:hidden; let IE6 support max-width instead of CSS code, but the effect is the same as other versions of the browser.

Let all browsers support Max-width CSS style code, complete: (Body music)
Max-width:1000px;_width:expression ((document.documentelement.clientwidth| | document.body.clientWidth) <1000? " 1000px ":"); Overflow:hidden; The 1000 and 1000px here are the values you need, note that the 3 values are the same.

When setting the maximum max-width don't forget to add overflow:hidden;
2, IE6 support Min-width solution-TOP

IE6 Support minimum width to resolve CSS code:
. Yangshi{min-width:1000px;_width:expression ((document.documentelement.clientwidth| | document.body.clientWidth) >1000? " 1000px ":" ");}

Description: min-width:1000px; This is IE6. The maximum range width is supported by other brand browsers. and _width:expression ((document.documentelement.clientwidth| | document.body.clientWidth) >1000? " 1000px ":"); let IE6 support min-width instead of CSS code, but the effect is the same as other versions of the browser.

Let all browsers support Min-width CSS style code, complete: (Body music)
Min-width:1000px;_width:expression ((document.documentelement.clientwidth| | document.body.clientWidth) >1000? " 1000px ":");
The 1000 and 1000px here are the values you need, note that the 3 values are the same.
3, let IE6 support Min-width at the same time support max-width solution-TOP

Let IE6 support the minimum width and support the maximum width limit setting. In this case we often touch on the picture control, so that the size of the picture, if too wide, can not exceed a certain range of values, small time does not control his method, using the CSS code:

_width:expression (This.scrollwidth > 620?) "620px": (This.scrollwidth < 1?) "1px": "Auto"));


Full code for picture control CSS:

Img{max-width:620px;_width:expression (This.scrollwidth > 620?) "620px": (This.scrollwidth < 1?) "1px": "Auto");}

Description: The picture cannot exceed the width of more than 620px, and not less than the width of 1 pixels.

Let all browsers include IE6 browser support maximum width and support minimum width div CSS code:
. yangshi{max-width:620px;min-width:1px;_width:expression (This.scrollwidth > 620?) "620px": (This.scrollwidth < 1?) "1px": "Auto");}

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.