WordPress.org

Support

Support » Themes and Templates » [Resolved] Conditional CSS not working?

[Resolved] Conditional CSS not working?

  • I’m trying to implement a conditional CSS for IE 7, but I can’t seem to get the code to work on any of my elements?

    Here’s a link to my website: http://test.johnhart-tech.com

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/print.css" media="print" />
    <!--[if lt IE 7]>
            <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/ie7-and-down.css" />
    <![endif]-->

    I’ve checked everything is linking properly and available, but any changes I make in the CSS aren’t reflected in IE7?

    Any help would greatly appreciated, I’m sure it’s just something small I’ve overlooked.

    Here is the code from my CSS

    .home_left ul {
    margin-left: 0px;}
    #home_button {
    	top:110px;
    	left:-960px; }
    #current_home {
    	top:110px;
    	left:-960px;
    }
    #navbar {
    	display:none;}
    #tagline { font-size:100px; }
    .sidebar-contact { height: 200px; }

Viewing 2 replies - 1 through 2 (of 2 total)
  • You are using incorrect code.

    <strong><!--[if lt IE 7]></strong>
            <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/ie7-and-down.css" />
    <![endif]-->

    This says to include the stylesheet if the IE version is LESS THAN 7.

    Correct is either
    <!--[if lte IE 7]> less than or equal to 7

    or
    <!--[if lt IE 8]> less than 8

    Legend! Got it working, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Conditional CSS not working?’ is closed to new replies.