11 replies [Last post]
lsiryan
Offline
newbie
LA
Last seen: 13 years 42 weeks ago
LA
Joined: 2008-12-12
Posts: 8
Points: 0

Hello all,

I have some slight layout issues (BG, etc) that I can fix by having slightly different CSS based on users browser. I searched the web and found that Internet Explorer accepts conditional statements in CSS to allow different CSS sheets to be loaded based on the browser. I found this code:

<link rel="stylesheet" type="text/css" href="css/chooser.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/chooser_ie.css" />
<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="css/chooser_IE6.css" />
<![endif]-->

According to what I can find, this should load in CHOOSER.CSS. Then, if the browser is IE (any version), it will replace CHOOSER.CSS with CHOOSER_IE.CSS. Then, then next conditional, if it is IE6 it will replace with CHOOSER_IE6.CSS

In this way I can load in the style sheet for the page based on the user's browser. This is the solution I would like. But for some reason, I cannot get it to work. I have looked all around, and from what I can find this code should work. I expect I am overlooking something, or doing something slightly wrong.

Any ideas? Thank you so much!

LSIRYAN

PS: I tested on machines running Chrome, Firefox, IE8 and IE6.

PPS: website is www.languagesystem.com/languagechooser.html

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 12 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

It will load the first one

It will load the first one on ALL browsers, then it will load the IE one in ALL IE browsers and then it will load the IE6 one in all IE6 browsers

In other words, IE6 will load ALL THREE stylesheets.

You will need to be more specific in each stylesheet to overwrite the one before.

Pretty sure we already covered this before - http://csscreator.com/node/33167

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

lsiryan
Offline
newbie
LA
Last seen: 13 years 42 weeks ago
LA
Joined: 2008-12-12
Posts: 8
Points: 0

Thank you! May I ask how to

Thank you!

May I ask how to overwrite the previous stylesheet?

Cheers,

LSIRYAN

PS: I the post you reference I could not understand the solution.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Deuce wrote:It will load the

Deuce wrote:

It will load the first one on ALL browsers, then it will load the IE one in ALL IE browsers and then it will load the IE6 one in all IE6 browsers

In other words, IE6 will load ALL THREE stylesheets.

You will need to be more specific in each stylesheet to overwrite the one before.

Pretty sure we already covered this before - http://csscreator.com/node/33167

Yes we have covered this Deuce (note name spelt correctly!)

Sorry but I'm calling a halt to this thread you should have continued in the original rather than slink off and start a repeat thread simply because you didn't understand my replies. I'm afraid that I covered this problem in some detail and tried to get you to understand what the situation was and in my final response asked you to explain what it actually was that you wanted to achieve rather than the approach to achieving that end, than we could have best advised you on the approach to take but sadly you decided not to respond :?

What deuce has replied is virtually word for word that which I first wrote in the initial response on the other thread, has that, for some reason, made more sense?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

lsiryan
Offline
newbie
LA
Last seen: 13 years 42 weeks ago
LA
Joined: 2008-12-12
Posts: 8
Points: 0

I am sorry to say this forum

I am sorry to say this forum blows. I asked for help and all i get is a bunch of grief. You (Hugo) offered no solution to me, that is why I asked others.

Oh well... bye.

LSIRYAN

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 12 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Would you like a

Would you like a refund?

Hugo is pretty horrible at all this CSS stuff, can't say I've seen a lick of helpful information come from that one... maybe he should be banned? Tony should probably quit too for giving this fool Mod status.

God what a crappy site. We should all just quit.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

Triumph (not verified)
Anonymous's picture
Guru

SULLYTHEWEB wrote:I am sorry to

SIMIANEXPERIMENT wrote:

I am sorry to say this forum blows. I asked for help and all i get is a bunch of grief. You (Hugo) offered no solution to me, that is why I asked others.

Oh well... bye.

CHEESEBAG

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

lsiryan wrote:I am sorry to

lsiryan wrote:

I am sorry to say this forum blows. I asked for help and all i get is a bunch of grief. You (Hugo) offered no solution to me, that is why I asked others.

Oh well... bye.

LSIRYAN

Hmm this is just the sort of attitude that furthers my belief that forums now are simply abused by those that perhaps should be a little more respectful of the fact that they are seeking FREE help from - in a lot of instances - people who have a experience and knowledge of a subject and who work professionally, to fail to grasp that fact and to assume that in some way they are deserving of this experience and guidance just f****** beggars belief.

Let me explain a little about that other thread you ran; firstly I did indeed help and helped greatly while demonstrating a good deal of patience as it was clear from the second comment the way the thread would run (that's born of a fair bit of experience here) I explained in a fair bit of detail why what you were expecting to happen wasn't , there was little more that I could do. Your part of the bargain was to try and understand that and work with me to find the solution rather than the asinine expectation that some wonderful solution would be handed to you on a plate. It behoved you - and I did ask - to provide an insight into just what was the problem that prompted you to believe that the conditional comments were required, if you had done that then I could have shown the way foreword; remember that you thought that CCs would switch styles and I explained that they wouldn't, that in actual fact was the completion of your original enquiry no more could be achieved, the next step was to explain further, as I asked you to.

Instead of thinking you decided that you would somewhat insultingly post a new thread and seek someone else's help or more to the point waste someone else's time this is also demonstrates a poor understanding of how to behave on a forum where you are seeking help.

Now, you have a further chance to prove that you have some level of intelligence and can swallow your pride and repost and seek the help that you require understanding that you do need to explain what the actual problem is NOT what you think the solution to it is that is for those experienced to decide after all that is why you have come here seeking help isn't it? of course you could take the other course of action and prove triumphs assertion that you are indeed a drama queen Smile it's entirely your choice I couldn't give a hang one way or another, if you post back and take the mature option then I am sure that Duece will help you out; I promise I'll keep well out as you seem to have little faith in my abilities Smile

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 12 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Hugo wrote:Duece Who's Duece?

Hugo wrote:

Duece

Who's Duece?

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

lsiryan
Offline
newbie
LA
Last seen: 13 years 42 weeks ago
LA
Joined: 2008-12-12
Posts: 8
Points: 0

To others than those who

To others than those who have commented. I got an instant, easy to understand, solution at this forum: http://forums.devshed.com/css-help-116/using-conditional-to-switch-css-based-on-user-s-browser-578264.html#post2175217

Might want to try as an alternative if you have the same problem I did.

To Hugo ET AL: Thanks for you help. It just seemed to me that you were rude and condescending... but that was perhaps me putting that on you. So if that was the case, sorry about that.

All the best!

LSIRYAN

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Isiryan if you read back

Isiryan if you read back through my original replies you will see that I did suggest the eventual answer that you received at devshed, the point about my methods is that I seek to empower - to some extent - the poster to attempt to work through their problems with my help, not as most seem to expect simply handing out answers (although I do that as well) At risk of sounding pompous (yes I seem to be often be accused of that , but sod it) this is more of a helpful approach than is realised.

As to the help you received , sadly it is not the best due to the fact that to do this is seldom the answer and I would have bothered to point out exactly why that's the case had you persevered with the thread. The poster at devshed provided an answer but hasn't really helped you I'm afraid.

And as for being rude and condescending? no I wasn't, never read into posts from people on these types of tech forums that kind of emotion, We often are matter of fact about things and blunt.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 39 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Dauce why did you pick a

Dauce why did you pick a name so difficult to spell Sad

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me