Web Analytics Made Easy -
StatCounter IE CSS Compatability Issue - CodingForum

Announcement

Collapse
No announcement yet.

IE CSS Compatability Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IE CSS Compatability Issue

    I'm having one hell of a time trying to get the div labelled "topleveler" on this page to maintain a height of 8px in Internet Explorer.

    http://www.dbxlabs.com/fopt/index2.php

    Can anyone pinpoint what I'm doing wrong? The only thing in the page that prevents it from validating as CSS is the _height property, but even removing that does nothing to fix the problem.

    Any help would be greatly appreciated.

    Thanks,

    Brandon

  • #2
    A div by default is already display:block; so no need to specify it again. Same goes for other divs. Problem with IE though is its accounting for line-height and sometimes font-size so this
    Code:
    	#topleveler {
    		width: 692px;
    		height: 8px;
    		display: block;
    		background-image: url('assets/topleveler.gif');
    	}
    should be this
    Code:
    	#topleveler {
    		width: 692px;
    		height: 8px;
    		line-height:0px;
                    font-size:0;
    		background-image: url(assets/topleveler.gif);
    	}
    Its also advised not to use quotes around your image names in css backgrounds because it may not show up on some browsers. Don't use the underscore hack just to feed css to IE6. There are better ways.
    Code:
    * html #contentdiv {
    height:500px;
    }
    or you can use conditional comments to feed it an IE only stylesheet
    Code:
    <!--[if lte IE 6]>
    <style type="text/css">
    #contentdiv {
    height:500px;
    }
    </style>
    <![endif]-->
    IE7 RC1 supports min-height and does not support the * html hack when its running in standards compliant mode.
    Last edited by _Aerospace_Eng_; Oct 4, 2006, 06:51 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      Excellent! Thank you so much!

      Comment

      Working...
      X