Title: Conditional CSS not working?
Last modified: August 20, 2016

---

# Conditional CSS not working?

 *  Resolved [johnpanz](https://wordpress.org/support/users/johnpanz/)
 * (@johnpanz)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/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](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)

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/conditional-css-not-working/#post-2499985)
 * 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
 *  Thread Starter [johnpanz](https://wordpress.org/support/users/johnpanz/)
 * (@johnpanz)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/conditional-css-not-working/#post-2500142)
 * Legend! Got it working, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditional CSS not working?’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [css](https://wordpress.org/support/topic-tag/css/)

 * 2 replies
 * 2 participants
 * Last reply from: [johnpanz](https://wordpress.org/support/users/johnpanz/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/conditional-css-not-working/#post-2500142)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
