Support » Themes and Templates » Css switch if IE vs FF

  • Ive been reading up on IE CSS issues vs FF and My site is having a huge problem with the coloring scheme in IE vs FF. Where can I ad a If statement to call a 2nd css file in my template directory that has the correct hex colors?

    Andrew

    example:
    <!–[if lt IE 7]>
    <link rel=”stylesheet” href=”ie.css” type=”text/css” />
    <![endif]–>

Viewing 8 replies - 1 through 8 (of 8 total)
  • BUMP… Therehas to be something for this…

    whooami

    (@whooami)

    Member

    > Where can I ad a If statement to call a 2nd css file in my template directory that has the correct hex colors?

    where is the current CSS you are using called?

    I’ll hazard a guess its in a file named header.php

    Unless im missing your point, this is one of those no-brainers.

    What you’re trying to use is called a “conditional comment”. You put it just before the closing </head> tag in your header.php file. (That’s the safest place to put it, as you need it to show up *after* the other stylesheet calls – otherwise the regular stylesheet will override whatever you have set for your IE stuff.)

    If all you’re doing is changing a few hex colors, you don’t really need to link to an entirely new stylesheet (although you *can*) – you can just put the stuff for IE right in there.

    <!--[if IE]>
    <style stype="text/css">
    body {background:pink;}
    </style>
    <![endif]-->

    Also, to make things easier on yourself (if you *do* want to just have a separate stylesheet for IE) – put the new stylesheet inside your theme – with the rest of the theme files you have. Then link to it like so:

    <!--[if IE]
    <link rel="stylesheet" href="<?php bloginfo('template_directory); ?>/ie_style.css" media="screen" />
    <![endif]-->

    Hope that helps you out.

    Thanks doodlebee ill give that a try!

    Andrew

    whooami

    (@whooami)

    Member

    your welcome.

    Using:
    <!–[if IE]>
    <style stype=”text/css”>
    body {background:pink;}
    </style>
    <![endif]–>

    Had no effect on IE vs FF inserting like this:

    <head>
    <!–[if IE]>
    <style stype=”text/css”>
    body {background:pink;}
    </style>
    <![endif]–>
    <title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
    <base href=”<?php echo get_settings(‘home’); ?>/” />
    <meta http-equiv=”content-type” content=”text/html;charset=<?php bloginfo(‘charset’); ?>” />
    <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” />
    <link rel=”stylesheet” type=”text/css” media=”screen,projection” href=”<?php bloginfo(‘stylesheet_url’); ?>” />
    <link rel=”stylesheet” type=”text/css” media=”print” href=”<?php echo get_settings(‘siteurl’); ?>/print.css” />
    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
    <link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” />
    <link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘atom_url’); ?>” />
    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
    <link rel=”icon” href=”<?php bloginfo(‘template_url’); ?>/favicon.png” />
    <?php wp_head(); ?>
    </head>

    ———————————–
    Inserting this:
    <!–[if IE]
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory); ?>/ie_style.css” media=”screen” />
    <![endif]–>

    Get this error:

    Hope that helps you o
    Parse error: syntax error, unexpected T_STRING in /home/imagehos/public_html/bombpost/wp-content/themes/neptune/header.php on line 26

    Heres the code:
    <head>
    <!–[if IE]
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory); ?>/ie_style.css” media=”screen” />
    <![endif]–>
    <title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>
    <base href=”<?php echo get_settings(‘home’); ?>/” />
    <meta http-equiv=”content-type” content=”text/html;charset=<?php bloginfo(‘charset’); ?>” />
    <meta name=”generator” content=”WordPress <?php bloginfo(‘version’); ?>” />
    <link rel=”stylesheet” type=”text/css” media=”screen,projection” href=”<?php bloginfo(‘stylesheet_url’); ?>” />
    <link rel=”stylesheet” type=”text/css” media=”print” href=”<?php echo get_settings(‘siteurl’); ?>/print.css” />
    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php bloginfo(‘rss2_url’); ?>” />
    <link rel=”alternate” type=”text/xml” title=”RSS .92″ href=”<?php bloginfo(‘rss_url’); ?>” />
    <link rel=”alternate” type=”application/atom+xml” title=”Atom 0.3″ href=”<?php bloginfo(‘atom_url’); ?>” />
    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
    <link rel=”icon” href=”<?php bloginfo(‘template_url’); ?>/favicon.png” />
    <?php wp_head(); ?>
    </head>

    First off:

    <!--[if IE]

    you’re missing the end. Should be:

    <!--[if IE]>

    Secondly, I said right before the *closing* head tag. You have it at the start, which is why there would be no effect. It has to be at the end.

    Spelling mistake. change

    <style stype=”text/css”>

    to

    <style type=”text/css”>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Css switch if IE vs FF’ is closed to new replies.