We are writing 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, then by DIVCSS5 for everyone to summarize the solution IE6 not support max-width and do not support Max-width method. Below is the CSS width IE6 support for minimum width and maximum width resolution (you may need to learn more about CSS width knowledge).
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 with superior other brand browsers to support maximum range width. and _width:expression (document.documentelement.clientwidth| | document.body.clientWidth) <1000? " 1000px ":"); Overflow:hidden IE6 supports max-width instead of CSS code, but the effect is the same as in other versions of browsers.
Let all browsers support Max-width CSS style code, complete:
Max-width:1000px;_width:expression (document.documentelement.clientwidth| | document.body.clientWidth) <1000? " 1000px ":"); Overflow:hidden; Here's 1000 and 1000px are the numbers you need, note that 3 values are the same.
When setting Max Max-width, don't forget to add overflow:hidden;
2, IE6 support Min-width Solution
IE6 supports 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 with superior other brand browsers to support maximum range width. and _width:expression (document.documentelement.clientwidth| | document.body.clientWidth) >1000? " 1000px "" "" "") is to let IE6 support min-width instead of CSS code, but the effect and other versions of the browser the same effect.
Let all browsers support Min-width CSS style code, complete:
Min-width:1000px;_width:expression (document.documentelement.clientwidth| | document.body.clientWidth) >1000? " 1000px ":");
Here's 1000 and 1000px are the numbers you need, note that 3 values are the same.
3, let IE6 support Min-width at the same time support max-width solution
Let IE6 support the minimum width and the maximum width limit setting. This situation we often encounter on the picture control, so that the size of the picture, if too wide, can not exceed a certain range of values, when the small time does not control his method, using CSS code:
_width:expression (This.scrollwidth > 620?) "620px": (This.scrollwidth < 1?) "1px": "Auto"));
Control CSS complete code for Picture:
Img{max-width:620px;_width:expression (This.scrollwidth > 620?) "620px": (This.scrollwidth < 1?) "1px": "Auto");}
This note: The picture can not exceed the width greater than 620px, and not less than 1 pixel width.
Allow all browsers including IE6 browsers to support maximum width and minimum width div CSS code:
. yangshi{max-width:620px;min-width:1px;_width:expression (This.scrollwidth > 620?) "620px": (This.scrollwidth < 1?) "1px": "Auto");}