Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Turning off stylesheets for IE7

Featured Replies

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.

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... :unsure:

  • 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.

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 by heydanreeves

  • 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?

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.

  • 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!

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.