Home > Web Front-end > HTML Tutorial > Fixed height div, automatically increases with content css definition method_html/css_WEB-ITnose

Fixed height div, automatically increases with content css definition method_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:27:53
Original
1505 people have browsed it

*{ font-size:12px; margin:0; padding:0;}
Method 1:
#testBox{border:1px solid #cccccc;padding:5px;width :220px;
min-height:100px; /*The minimum height value is set to: 100px*/
height:auto !important; /*Compatible with FF, IE7 also supports the !important tag*/
height: 100px; /*Compatible with ie6*/
Method 2:
/*This method can also be used alone*/
height:expression(this.height < 100 ? "100px" : this.height "px");




< meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Untitled Document







  • Here is the height of each record. . . . .







source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template