Trueskool
Member
Posted 4 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?
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.
Trueskool
Member
Posted 4 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.
what's the URL of your site?
@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.