Technology Programming

Howto: min-height for ie6?

The CSS style min-height is not supported correctly by Microsoft Internet Explorer 6.0 and earlier versions. This is another reason (in addition to hundreds of reasons!) to switch to a newer web browser like Opera or Mozilla Firefox.

So, How could you -a web developer- fix this behavior and make Microsoft Internet Explorer 6.0 correctly show a minimum height for an element in your web page, just with a small CSS code, without many nested and so long elements?

Actually, There are a few solution to (hack) Microsoft Internet Explorer 6.0 and make it display a (min-height) for an element in your page.

You can find a very long solution here [http://www.greywyvern.com/code/min-height-hack]! I prefer you don't read it! The following solution in this article is the easiest one!

Simply, You can use this piece of code to give any element a minimum height (ie: min-height). This is valid for any element in your web page:

selector {
min-height: 500px;
height: auto!important;
height: 500px;
}

The first line and second line: will affect all modern browsers and make the min-height equals to 500 pixels (for example, of course you can change it to any value). and make the height is auto (to fit the content). This auto value is (important). That means it will not be changed with the third line.

Microsoft Internet Explorer 6.0, Will ignore the first line and the second line, and will only apply the third line. If the content of the element needs more than 500 pixels (again, this value for example, of course you can change it to any value you want), it will increase the height of the element to fit all the content inside it!

Assuming Microsoft Internet Explorer 6.0 will not fix the correct implementation for the!important declaration and assuming that if IE7 does, they'll also implement min-height correctly.

The above snippet of CSS works properly in Microsoft Internet Explorer 6.0, Firefox and any Mozille or Gecko web browser, Opera browser 7.x+, Safari browser1.2

This is the fastest and easiest solution for this problem!

Many thanks to Dustin Diaz for sharing!
SHARE
RELATED POSTS on "Technology"
WordPress - How to Set up a New Theme to WordPress 3.
WordPress - How to Set up a New Theme to WordPress 3.
Solution of Creative Web Design
Solution of Creative Web Design
The three disciplines of User Experience
The three disciplines of User Experience
Web Design Sheffield Options For Professional Enterprises
Web Design Sheffield Options For Professional Enterprises
Do you have what it takes?
Do you have what it takes?
Segway Cost
Segway Cost
Microsoft Access 2010: What's Coming with Office 2010?
Microsoft Access 2010: What's Coming with Office 2010?
Companies of Web Development in Ireland Provide Designs that Work
Companies of Web Development in Ireland Provide Designs that Work
Penguin Update to Put Red-Flags on Negative SEO
Penguin Update to Put Red-Flags on Negative SEO
Innovative web 2 design templates can make your business famous quickly
Innovative web 2 design templates can make your business famous quickly
Building A Search Engine Friendly Website
Building A Search Engine Friendly Website
Exceptional Advice To Build Up Your Internet Marketing
Exceptional Advice To Build Up Your Internet Marketing
The Benefits of Selecting The Right Hosting Company
The Benefits of Selecting The Right Hosting Company
Is There a Methodology for Making Successful Logos
Is There a Methodology for Making Successful Logos
Benefits of Ruby On Rails Development
Benefits of Ruby On Rails Development
The Power of Colour and Shapes in Your Infant's Life.
The Power of Colour and Shapes in Your Infant's Life.
Advantages of Hiring PSD To HTML Service Providers
Advantages of Hiring PSD To HTML Service Providers
How to Make Responsive Web Design Attractive?
How to Make Responsive Web Design Attractive?
Converting PSD to Responsive HTML
Converting PSD to Responsive HTML
Just a few realy really hints and tips when it comes to website design but look for.
Just a few realy really hints and tips when it comes to website design but look for.

Leave Your Reply

*