Search Blog Posts

Posts Tagged ‘css hacks’

Min-height hack for Internet Explorer 6

Tuesday, April 22nd, 2008

Yes thats correct, another css hack for i.e 6 this time it’s ‘min-height’. As some of you are probably aware i.e 7 now supports the ‘min-height’ css property making our lives much simpler, or rather even more complicated as we have to create hacks or work arounds for old browsers such as i.e 6. 

Show below i have included the css for creating a div element with a minimum height, of course this could be applied to any element of your html document. For the div example that i am showing, this method is incredibly usefull when you have content that does not fill a specified area on your webpage. By using the min-height property you will effectivley allow your div to scale and expand but the hight will go no lower than the specified pixel size (e.g. 200px).

What you will see below is the basics of getting your div to display correctly on nearly all browsers (I haven’t managed to find any that dont support this method).

Example of min-height code

mydivname {
  min-height:200px;
  height:auto !important;
  height:200px;
}

Try it out and see how easy it is to use.

IE Only CSS Hacks and IE 6 or below Hack

Wednesday, February 20th, 2008

If you’ve created your website but want to style or change the formatting of your css depending on the users browser version, ie allows you to set a different css style sheet using this handy little hack.

Internet explorer recognises the following:

If you need to target any users browser that is just internet explorer simply use the follwoing code and place in your <head> </head> tags.

<!--[if IE]>
<link rel=”stylesheet” type=”text/css” href=”css/ie.css” mce_href=”css/ie.css” />
<![endif]–>

If you need to target any users browser that is internet explorer below version 7, e.g. 6, 5, 5.5… use the following code and place in your <head> </head> tags.

<!--[if lte IE 6]>
<link rel=”stylesheet” type=”text/css” href=”css/ie6orlower.css” mce_href=”css/ie6orlower.css” />
<![endif]–>

© Copyright 2003-2008 Minimalistic Designs | Terms | Links | Sitemap
Website Design Liskeard - www.minimalistics.co.uk