Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 112846

Andrew Nevins on "Custom .css for IE not working"

$
0
0

In the mean-while, let's try using JavaScript to add a class in your <body> element if the browser is IE7 or less. So you can target pages in CSS that only have that class.

Instead of your iestyle.css file, can you try adding this JavaScript;

<script type="text/javascript">
 jQuery(document).ready(function($) {
    $('body').addClass('ie7');
 });
</script>

So, from this;

<!--[if lte IE 7]>
<link href="http://www.enlightenedinnergame.com/wp-content/themes/twentyeleventest/iestyle.css" rel="stylesheet" type="text/css" />
<![endif]-->

To this;

<!--[if IE 7]>

<script type="text/javascript">
 jQuery(document).ready(function($) {
    $('body').addClass('ie7');
 });
</script>

<![endif]-->

Viewing all articles
Browse latest Browse all 112846

Trending Articles