• [For reference I am using a customized version of the Kubrick default theme]

    I am trying to create a conditional statement for IE such that my sidebar displays the same top margin in Firefox and IE. I have two style sheets: style.css and styleie.css both loaded in the default template folder for my theme. The only difference in the styleie.css sheet is the removal of margin-top: 55px;.

    Here are the CSS differences:

    style.CSS:
    #sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 645px;
    margin-top: 55px;
    width: 250px;
    }

    styleie.css:
    #sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 645px;
    width: 250px;
    }

    I then have the conditional if statement loaded in my header.php file. It is as follows:

    <head profile=”http://gmpg.org/xfn/11″&gt;
    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />

    <title><?php wp_title(‘«’, true, ‘right’); ?> <?php bloginfo(‘name’); ?></title>

    <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” />

    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />

    <style type=”text/css” media=”screen”>

    <?php
    // Checks to see whether it needs a sidebar or not
    if ( empty($withcomments) && !is_single() ) {
    ?>
    #page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/sidebar_900_roll_white.jpg”) repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    #page { background: url(“<?php bloginfo(‘stylesheet_directory’); ?>/images/sidebar_900_roll_white.jpg”) repeat-y top; border: none; }
    <?php } ?>

    </style>

    <?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); ?>

    <?php wp_head(); ?>

    <link rel=”shortcut icon” href=”<?php bloginfo(‘template_directory’); ?>/favicon.ico” />

    <!–[if IE]>
    <link rel=”stylesheet” type=”text/css” href=”http://www.charminginnovations.com/wp-content/themes/default/styleie.css&#8221; />
    <![endif]–>

    </head>

    I have also tried using:

    <!–[if IE]>
    <link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘template_directory’); ?>/styleie.css” />
    <![endif]–>

    Nothing seems to be working. I have searched the codex and Google and implemented every solution I can find to no avail. I greatly appreciate any help you can offer.

Viewing 1 replies (of 1 total)
  • Do you have only the following code in styleie.css? Are you sure the file is plain text?

    #sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 645px;
    width: 250px;
    }

    And use the conditonal with the bloginfo call; that’s the most reliable in the long run.

    And, are you using IE on a windows box to look at the changes and not under a virtual machine?

Viewing 1 replies (of 1 total)
  • The topic ‘IE Conditional Statement for CSS Stylesheet Not Working’ is closed to new replies.