WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Conditional CSS not working? (3 posts)

  1. johnpanz
    Member
    Posted 2 years ago #

    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; }
  2. stvwlf
    Member
    Posted 2 years ago #

    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

  3. johnpanz
    Member
    Posted 2 years ago #

    Legend! Got it working, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic