The minimum height can be set to the minimum height of a BOX. When the content of a BOX is small, the height of the BOX can be kept to a certain level, and the BOX will be automatically extended down until now, only supported by Opera and Mozilla, and IE7 was also supported at the beginning, but IE7 is in the testing stage. It may take a long time to wait for the official version to become popular, unless MS binds it to an operating system, how can we reasonably and skillfully use it at least on the existing basis (IE6 80-90%?
Assuming there are two boxes, we need the minimum height of the BOX to be 150PX.
| The code is as follows: |
Copy code |
CSS Div. box1, div. box2 { Width: 300px; Min-height: 150px; Background: # EEE; Float: left; Margin-right: 20px; } Xhtml <Div> IE does not keep the minimum height of 150px </div> <Div> The minimum height can be set to the minimum height of a BOX. When there are few contents, the height of the BOX can be kept to a certain level. </div>
|
In the current results, IE does not keep the minimum height of 150px.
Solution
Set a height for IE
| The code is as follows: |
Copy code |
* Html div. box1, * html div. box2 {height: 150px ;} The solution of wellstyled.com is to use Attribute Selectors of CSS) Div. box1, div. box2 {... height: 150px ;} /* IE depends on this to keep the minimum height. If the height is exceeded, it will automatically extend down */ Div [class]. box1, div [class]. box2 {height: auto ;} /* DIV objects with class attributes */
|
IE is naturally not supported. It is supported by Opera and Mozilla to read this height. Applicable scenarios: Search, articles, and other pages (no 100% height is used. When there are few searched content, the page will not be too short.