Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 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
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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_; 10-04-2006 at 10:51 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excellent! Thank you so much!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •