CSS controls the div width, maximum width, height, and minimum width/height. cssdiv
The maximum width/height or minimum width/height of a div is often controlled during webpage creation. However, many friends in IE6 may encounter incompatibility problems, I also often encounter such problems. I found many problems on Baidu and could not solve them. Later I learned it on a forum. Here I will share with you the css3 style code, it is time-compatible with major browsers.
* Minimum degree of parallelism */. min_width {min-width: 300px;
/* Sets max-width for IE */
_ Width: expression (document. body. clientWidth <300? "300px": "auto ");
}
/* Maximum degree of parallelism */
. Max_width {
Max-width: 600px;
/* Sets max-width for IE */
_ Width: expression (document. body. clientWidth> 600? "600px": "auto ");
}
/* Minimum 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 and minimum degree of parallelism */
. 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 and 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 ")
);
}