SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: height: auto !important; ?

  1. #1
    SitePoint Guru solidcodes's Avatar
    Join Date
    Jul 2006
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    height: auto !important; ?

    Okay can someone explain to me what these codes do,
    Code:
    #nav_left{ 
    	float:left;
    	width:260px;
    	background-color: orange;
    	color: white; 
    	min-height:650px; /* for modern browsers */
    	height: auto !important; /* for modern browsers */
    	height:1200px; /* for IE5.x and IE6 */
    }
    So what is these codes below mean?
    Code:
    height: auto !important;
    Thank you very much in advanced.
    I Love JavaScript & jQuery...

  2. #2
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    19,971
    Mentioned
    216 Post(s)
    Tagged
    2 Thread(s)
    !important just disables the normal cascade rules—meaning that this rule must apply even if a more specific height declaration would normally override this one. Generally, it's better not to use !important, as it indicates that things could be better coded from scratch. !important is really just a last resort option.

    In this case, it might be meant to override the following declaration, which otherwise would override the height: auto rule.

    The code looks a bit old, anyhow, as both IE5 and IE6 are dead and gone for all practical purposes.

  3. #3
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Yes, that was an old IE6 hack that was used when combining all your rules in one syntax (ruleset)

    It was always better just to use min-height for good browsers and feed IE6 it's own hack in a separate ruleset.
    IE6 treated height as if it was min-height due to it's expanding box bug.

Bookmarks

Posting Permissions

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