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.

Problems with linking to different CSS for IE6,7 and 8

Featured Replies

Hi there,

 

This is my first post so hello to all!

 

I've been doing some web design in my spare time and have a site up and running, however, I know it doesn't look right in IE 6 and 7.

 

I have done a lot a reading and thought I understood it, but I obviously don't!

 

As a test I have created another CSS file called ie8.css and linked to in using,

 

<!--[if IE 8]>

<link rel="stylesheet" type="text/css" href="css/ie8.css" />

<![endif]-->

 

on the index.php page. The ie8.css is exactly the same as the main CSS file except I have removed the background image from the main content box, but when I view the page using IE8 the image is still there so therefore it still must be using the main style sheet?!

 

What am I doing wrong?!

 

The ultimate aim is to have separate sheets for IE 6 and 7, but as I test I am using IE8 becuase I don't have access to IE 6&7 at the moment.

 

Thanks in advance.

Aha. Right, I can see where you're going wrong. The IE-specific stylesheets should be called after the main stylesheet and should contain ONLY rules to override the main one. For example, to get what you've described you'd want your IE8 sheet to consist of:

 

div#content {
background-image: none;
}

 

(replacing div#content with whatever yours is called).

  • Author

Aha. Right, I can see where you're going wrong. The IE-specific stylesheets should be called after the main stylesheet and should contain ONLY rules to override the main one. For example, to get what you've described you'd want your IE8 sheet to consist of:

 

div#content {
background-image: none;
}

 

(replacing div#content with whatever yours is called).

 

Thanks for the fast reply!

 

It was being called after the main CSS was but there was another sheet been called for my rotator. I moved it below that, removed all other CSS and boom it worked!!

 

Thanks a lot!

Edited by tangerine_dreamer

  • Author

Why do you need seperate stylesheets for ie8 7 & 6 ?

 

what problems are you having

 

A few of the margins and padding were rednering slightly different on IE7, and in IE6 it looks a complete mess, but that's going to be work in progress!

 

Thanks again

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.