March 11, 201313 yr A site I'm working on is beyond saving in IE7, so I'm going to drop support for it. However as it is most of the content isn't even visible, so I was wondering if you can just turn the stylesheets off and let it run just from the HTML. I'm pretty sure css-tricks.com does this in IE7.
March 11, 201313 yr Have you tried creating a conditional stylesheet for IE 7 that's empty? Something like this... <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="ie7.css"> <![endif]--> Although I'm too sure why you would want to do that... surely some support is better than none...
March 11, 201313 yr Author Yeah I've got a conditional stylesheet loaded, an empty stylesheet would still inherit previous stylesheets. It would require a great deal of work to even get the site remotely usable in IE7. My nav is nested in my header, and hovering over elements breaks the whole site. Im really not sure it's worth all the effort. Funnily enough it required minimal CSS for IE8 to work well, just IE7 seems beyond repair.
March 12, 201313 yr You can do it with IE conditionals but you'll need two or three lines. // Targets IE 7 and down <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="ie7-style.css" /> <![endif]--> // Targets all IE above 7 <!--[if gte IE 8]> <link rel="stylesheet" type="text/css" href="style.css" /> <![endif]--> // Targets all other browsers <!--[if !IE]><!--> <link rel="stylesheet" type="text/css" href="style.css" /> <!--<![endif]--> EDIT: This article may also be helpful: http://stuffandnonsense.co.uk/blog/about/universal_internet_explorer_6_css The general idea is to use <link rel="stylesheet" type="text/css" media="screen, projection" href="http://universal-ie6-css.googlecode.com/files/ie6.0.3.css" /> for the old IE browsers you're not supporting. It's just a general typographical stylesheet so your content will still be accessibile. Edited March 12, 201313 yr by heydanreeves
March 12, 201313 yr Author I've put a conditional around all the stylesheets, so they load everywhere but in IE7 and down. It works but I'm wondering if this will add to the load time in normal browsers. Does it create another http request?
March 12, 201313 yr It will add to the load time in regards to having an extra few lines of text, so negligible really. But no, browsers won't download the other stylesheets. AFAIK, the browsers that the conditionals don't apply to simply don't see that text, as if it had been commented out.
March 12, 201313 yr Have you run your site through http://validator.w3.org/ ? That often fixes a large majority of compatibility issues once its validated.
March 12, 201313 yr Author Ran it through the validator and it did find the reason, I had <li> tags in the <nav>. I didn't realise this was an issue. Quite a quick fix really as I had <a> tags in the <li>tags anyway, so just put the styles from the <li> tags into to <a> tags. Always coded navigation with <li>'s guess it's time to stop!
March 12, 201313 yr Make sure you are using a shim for older browsers if you're going to use HTML5 elements. The fact that nav elements (plus all the others, if you're using them) don't render with any styling in browsers that don't support them may be breaking your site.
Create an account or sign in to comment