Welcome Guest!

If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:

  • Receive Fast Advice
  • Learn Programming Languages
  • Get Professional Website Reviews
  • Quick Troubleshooting Assistance

> Conditional Stylesheet Won't Work!

This is a discussion on Conditional Stylesheet Won't Work!, within the CSS section. This forum and the thread "Conditional Stylesheet Won't Work!" are both part of the Designing Your Website category.

 
Reply to this topicStart new topic
> Conditional Stylesheet Won't Work!, Can get it to work for all IE but not IE6 specifically.
Itsumishi
post May 21 2008, 12:28 AM
Post #1


Squeezing
***

Group: Members
Posts: 68
Joined: 5-March 08
From: Melbourne, Australia
Member No.: 195



Hi.

After the very long debacle of getting the menu to work on the site I have been building I seem to only have one tiny weeny problem left and I'm hoping it's easily solved.

In IE6 because of the box-model problem the menu is a smidgen too long and doesn't fit into it's designated space.
I found that if I adjusted the width by 1px accross all the menu options it fit well enough in IE6 however this of course makes all other browsers look that tiny bit wrong.

My initial thought was EASY! I'll just make a conditional stylesheet that's only relevent to IE6.
However for some reason I can't get this to work.
I can get one to work for all IE's, but not specifically IE6. This of course makes IE7 look wrong!

What am I doing wrong?

CODE
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" media="screen" href="css/ie6only.css" />
<![endif]-->


As I said, if I remove the 6 it works but it stuffs up IE7. I've read a few places as well as Craigs article on Conditional Comments but unfortunantly no luck so far.

This post has been edited by Itsumishi: May 21 2008, 12:47 AM
Go to the top of the page
 
+Quote Post
Antti
post May 21 2008, 12:57 AM
Post #2


Rapid Squeezer
****

Group: Members
Posts: 176
Joined: 15-February 08
From: Finland
Member No.: 139



Your conditional comment seems to be just fine. Is the path to the css file correct? Have you tested it with something you can clearly see like background-color: #000;. Try to put that same conditional comment and insert some text inside it like <p>This is for IE6</p> and see if that shows up. Ofcourse you need to move it inside body tag.

You can also try
CODE
<!--[if lt IE 7]>
<p>This message is only displayed in browsers earlier than IE7.</p>
<![endif]-->


--------------------
anttisimonen.com - .NET developer
Go to the top of the page
 
+Quote Post
MikeHopley
post May 21 2008, 03:29 AM
Post #3


Rapid Squeezer
****

Group: Mentor
Posts: 414
Joined: 15-February 08
From: UK
Member No.: 143



It's also possible your installation of multiple IE's is duff.

This is the best package: http://tredosoft.com/Multiple_IE/
Go to the top of the page
 
+Quote Post
Rakuli
post May 21 2008, 03:33 AM
Post #4


Rapid Squeezer
****

Group: Team Leaders
Posts: 497
Joined: 13-February 08
From: Catching the squeezed drips downunder.
Member No.: 13



Are you sure you're adhering to the cascade principle? That conditional comment has to come AFTER the initial style sheet...

You can also try the Less Than option

CODE
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="css/ie6only.css" />
<![endif]-->


--------------------
Bright Idea? -- Don't Let it disappear
Go to the top of the page
 
+Quote Post
Itsumishi
post Jun 10 2008, 10:34 PM
Post #5


Squeezing
***

Group: Members
Posts: 68
Joined: 5-March 08
From: Melbourne, Australia
Member No.: 195



QUOTE (MikeHopley @ May 21 2008, 06:29 PM) *
It's also possible your installation of multiple IE's is duff.

This is the best package: http://tredosoft.com/Multiple_IE/


I think this was what was causing my problem. For most things IE6 was working fine but some things just didn't seem to work properly.
For example on the Son of Suckerfish demo pages my version of IE6 would not display any of the drop downs.
Go to the top of the page
 
+Quote Post
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   12 gribble 251 19th February 2008 - 05:49 AM
Last post by: welshstew
No New Posts   1 Jason 48 11th March 2008 - 10:16 AM
Last post by: Rakuli
No New Posts   11 Jason 158 19th March 2008 - 06:57 PM
Last post by: Monie
No New Posts   1 Jason 83 21st May 2008 - 11:49 AM
Last post by: paintingtheweb
No New Posts   1 Jason 52 26th March 2008 - 08:22 PM
Last post by: christopher