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.

why wont IE recognise my IE only stylesheet?

Featured Replies

like the title says I'm trying to get Internet explorer to recognise a specific style sheet but it's just not having it and I'm running out of hair to pull out, so if some kind soul knows what I'm doing worng or what;s up please let me know.cheers

 

here's the head of the document

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>donewithcrayons</title>

<link href="style.css" rel="stylesheet" type="text/css" />
<!-- Import jQuery and SimpleModal source files -->
<script src='js/jquery.js' type='text/javascript'></script>
<script src='js/jquery.simplemodal.js' type='text/javascript'></script>
<!-- Contact Form JS and CSS files -->
<script src='js/contact.js' type='text/javascript'></script>
</script>
<!--[if lt IE 7]>
       <script type="text/javascript" src="unitpngfix.js"></script>
	<link href="ieonly.css" rel="stylesheet" type="text/css"  />
<![endif]--> 
<link type='text/css' href='css/contact.css' rel='stylesheet' media='screen' />

</head>

Which IE version are you testing in?

The conditional comment you are using only targets IE6 and below.

If you want to target IE7 as well, you'll need to change it to

<!--[if lte IE 7]>
<script type="text/javascript" src="unitpngfix.js"></script>
<link href="ieonly.css" rel="stylesheet" type="text/css" />
<![endif]-->

Note the lte meaning less than or equal to.

If you are using a standalone version of IE6 and IE7 on the same PC it will not recognize conditional comments because the version number in the registry is incorrect. To resolve this have a look at this article: LINK

like the title says I'm trying to get Internet explorer to recognise a specific style sheet but it's just not having it and I'm running out of hair to pull out, so if some kind soul knows what I'm doing worng or what;s up please let me know.cheers

 

I've had this problem and it turned out that the conflict of styles in the main stylesheet caused IE6 to ignore its stylesheet. Try adding the ! important declaration to your ieonly.css, like this example:

 

#div {width: 100% ! important;}

 

Note the space between the exclamation mark and 'important'.

Just noticed that you have another link to a stylesheet below the conditional comment.

Always place the conditional comments after any other links to style sheets otherwise they will possibly be overridden.

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.