Recent Posts
- (02/24) Calling an Element from a Helper TAGS:CakephpWeb ProgrammingUsageTutorialExample
- (10/14) Forcing A Single Join in CakePHP PaginationTAGS:CakephpCakephp 13DatabaseErrorsHabtmMysqlMssqlWeb ProgrammingUsage
- (08/11) Inserting NOW() into MySQL Using CakePHPTAGS:CakephpDatabaseMysqlMssqlWeb ProgrammingUsage
- (08/07) Best PaginateCount for CakePHP - with Group By SupportTAGS:CakephpBehaviorsWeb ProgrammingUsageDatabaseExampleMysqlHabtmHack
- (04/03) CakePHP Error Messages Not Showing on FormTAGS:CakephpCakephp 13Web ProgrammingErrorsUsage
- (02/06) Sorting Paginated Results Using a Related Model Field in CakePHPTAGS:CakephpWeb ProgrammingUsageExample
- (11/02) Changing CakePHP's Model useTable on the FlyTAGS:CakephpWeb ProgrammingMysqlDatabaseExampleTutorial
- (10/18) The Funniest Error Message Ever - Thank You EclipseTAGS:EclipseWeb ProgrammingErrorsHumorWindowsUsageSoftwarePhpCakephp
Subscribe to my feed
MainelyDesign.com Blog
CSS Min-Height Hack in Internet Explorer
Posted on 12/15/2009 at 10:18 am by Kevin Wentworth
Viewed 1,977 times | 0 comments
Another day of web developing with CSS and another day of needing a hack for IE6 and IE7. This isn't really a hack so much as it's a method of ordering statements in your CSS declaration that yields a working min-height declaration in Internet Explorer. Well, I guess it's a hack (but I hate using them).
CSS min-height will be used in browsers that support it
In web browsers that support the min-height property, it will be used. In browsers that don't support it, height will be used. For browsers that support !important, the height will be set to auto (with a min-height property). For browsers that don't support !important, ah-hem IE6, the height will be set to a fixed height.
CSS min-height magic
The following code is what I used in my CSS style sheet to make my container div at least 879px tall. (I found it here)
- #container {
- * a little magic to make min-height work in IE */
- min-height: 879px;
- height: auto !important;
- height: 879px;
- }
IE6 is not !important
Two things work in our favor with how IE6 works- 1) it doesn't support !important and 2) the height, even though set to a fixed height, will still expand to the needed height of the container div.
Cheers,
-Kevin Wentworth
Tags for CSS Min-Height Hack in Internet Explorer
Css | Example | Hack | Ie | Internet Explorer | Web Design
