WordPress.org

Ready to get started?Download WordPress

Forums

IE Hacks (5 posts)

  1. Trueskool
    Member
    Posted 6 years ago #

    Hey,

    I made a new wordpress theme for a site I've been working on and it's not displaying properly in IE. So I placed this code into my header.php document:

    <!--[if lte IE 7]>
    	<link rel="stylesheet" type="text/css" href="ie.css" />
    <![EndIf]-->

    When I view the site in internet explorer it still links to the default style.css document.

    Is there a way to change this so that it links to my desired file when view the site in Internet Explorer?

    Thanks!

    Also: how can I change the default CSS file location, to something other than style.css in the major directory?

  2. Marcel Brinkkemper
    Member
    Posted 6 years ago #

    Hey,
    With this code, the ie.css is loaded additionally to style.css
    I would suggest to use ie.css only for elements that do not display correctly in IE.
    ie.css overrides style.css.

  3. Trueskool
    Member
    Posted 6 years ago #

    This code isn't working at all though, style.css is loading instead of ie.css when viewing the site in Internet Explorer.

  4. Marcel Brinkkemper
    Member
    Posted 6 years ago #

    what's the URL of your site?

  5. Jeremy Clark
    Moderator
    Posted 6 years ago #

    @Trueskool:
    You need to load your regular style sheet then load the IE only stylesheet so the ie only rules take precedence over rules in your regular style sheet.

    <link rel="stylesheet" type="text/css" href="style.css" />
    <!--[if lte IE 7]>
    <link rel="stylesheet" type="text/css" href="ie.css" />
    <![EndIf]-->

    This is what it should look like.

Topic Closed

This topic has been closed to new replies.

About this Topic