InWeb AuthoringOften to control the maximum width of the div width/height or the minimum width/height, but in IE6 many friends will encounter incompatible headache problems, including I also often encounter such problems, in Baidu search a lot of can not solve, and later in a forum to learn, here with you to share underCSS3 StyleCode, through time fully compatible with major mainstream browsers.
* Minimum width of */.min_width{min-width:300px;
/* Sets max-width for IE */
_width:expression (Document.body.clientWidth < 300?) "300px": "Auto");
}
/* Maximum width */
. max_width{
max-width:600px;
/* Sets max-width for IE */
_width:expression (Document.body.clientWidth > 600?) "600px": "Auto");
}
/* min. Height */
. min_height{
min-height:200px;
/* Sets min-height for IE */
_height:expression (This.scrollheight < 200?) "200px": "Auto");
}
/* Maximum Height */
. max_height{
max-height:400px;
/* Sets max-height for IE */
_height:expression (This.scrollheight > 400?) "400px": "Auto");
}
/* Maximum minimum width */
. min_and_max_width{
min-width:300px;
max-width:600px;
/* Sets Min-width & max-width for IE */
_width:expression (
Document.body.clientWidth < 300? "300px":
(Document.body.clientWidth > 600?) "600px": "Auto")
);
}
/* Maximum minimum height */
. min_and_max_height{
min-height:200px;
max-height:400px;
/* Sets Min-height & max-height for IE */
_height:expression (
This.scrollheight < 200? "200px":
(This.scrollheight > 400?) "400px": "Auto")
);
}
CSS Control div width max width/height and min width/height