WordPress.org

Forums

css file for ie7 issues not recognized (4 posts)

  1. alefmemalef
    Member
    Posted 3 years ago #

    Hi,
    I have created a child theme from twenty eleven to an rtl website, and since in ie7 things aren't as they should be, I created an ie7.css file and inserted conditional comments to the head.
    This is the code:

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

    Now something must be wrong in the code becauses the ie7.css file is being completely ignored.
    Anyone?
    Thanks

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Browser specific CSS is handled a little differently in Twenty Eleven. If you look in header.php, you'll see the lines:

    <!--[if IE 7]>
    <html id="ie7" <?php language_attributes(); ?>>
    <![endif]-->

    which means that any IE7 specific CSS is handled in the main stylesheet using html#ie7. That's what you need to add in your child's main stylesheet.

  3. alefmemalef
    Member
    Posted 3 years ago #

    Thanks,
    I've just been trying to work with the child's main stylsheet (style.css) -
    Tried-#ie7 #branding{} and #ie7 #access{} and that didn't take, then I tried #ie7 branding{} and #ie7 access{} and that didn't take either.
    What am I doing wrong now?

  4. alefmemalef
    Member
    Posted 2 years ago #

    For the benefit of anyone who might encounter the same problem -
    My child theme is RTL. I considered style.css to be my child's main stylesheet but nothing I did in there took. I discovered that rtl.css is the stylesheet that has to be edited with regards to ie7 issues.
    And of course #ie7 #branding{} and #ie7 #access{} are the correct code.

Topic Closed

This topic has been closed to new replies.

About this Topic