How to add multiple style files

This is a discussion on "How to add multiple style files" within the Web Page Design section. This forum, and the thread "How to add multiple style files are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 21st, 2008, 13:23
Reputable Member
Join Date: Mar 2007
Location: Kenya
Age: 19
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to geyids Send a message via Yahoo to geyids Send a message via Skype™ to geyids
How to add multiple style files

Is it possible to have a stylesheet for IE and firefox differently? Maybe the firefox one to be the default then IE should choose the one for its own
Reply With Quote

  #2 (permalink)  
Old Feb 21st, 2008, 16:04
dangergeek's Avatar
Moderator
Join Date: Feb 2007
Location: UK
Posts: 172
Thanks: 0
Thanked 3 Times in 3 Posts
Re: How to add multiple style files

Yep, its a hack using something called conditional comments.

Check out this mini explanation from Januarys edition of Webforumz own Crative Coding Newsletter
http://creativecoding.webforumz.com/...8/january/faq/
Reply With Quote
  #3 (permalink)  
Old Feb 21st, 2008, 18:39
Junior Member
Join Date: Jul 2007
Location: Los Angeles
Age: 31
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to add multiple style files

I'd use a JavaScript sniffer as you can push to specific O/S, browsers and versions:

http://www.webreference.com/tools/br...avascript.html
Reply With Quote
  #4 (permalink)  
Old Feb 21st, 2008, 18:44
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: How to add multiple style files

Imagn - but then if the browser has javascript happens then what? If CSS (which is always on) can do the same job javascript can do (which is not always on) why use Javascript and risk it?
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #5 (permalink)  
Old Feb 21st, 2008, 18:44
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,011
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: How to add multiple style files

Quote:
I'd use a JavaScript sniffer as you can push to specific O/S, browsers and versions:
I would not recommend a Javascript sniffer as;

a) It's client-side. If the user has it disabled, the sniffer will fail and you will not have control (as Jack mentioned)

b) It's poor coding

Any site can be designed to be browser-compatible, with perhaps a few browser specific hacks if neccessary (see dangergeek's link for serving stylesheets to IE)

Best advice - design for Firefox, then fix IE with conditional comments. Browsers such as Opera and Safari will (usually) follow suit
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #6 (permalink)  
Old Feb 21st, 2008, 18:54
Junior Member
Join Date: Jul 2007
Location: Los Angeles
Age: 31
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to add multiple style files

Yes and what happens when they don't follow suit? Just tell the client "Oh, well"?

While I'd agree a vast majority of the time yes, we've had a instances where just using hacks did not cover minor spacing variations across MAC FireFox 1.5 & 2, Opera and Safari and PC IE 6 & 7 and FireFox 1.5 & 2.

The default response is always "What if JS is turned off" but that argument doesn't hold much water anymore as an overwhelming percentage of browsers do.

Regardless this was another option that some people might discover they need to do. Perhaps I misspoke and should have worded as "Another possibility is..."

Last edited by imagn; Feb 21st, 2008 at 19:05.
Reply With Quote
  #7 (permalink)  
Old Feb 21st, 2008, 19:05
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: How to add multiple style files

imagn - if you can code well then you do not need to use the Javascript.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #8 (permalink)  
Old Feb 21st, 2008, 19:09
Junior Member
Join Date: Jul 2007
Location: Los Angeles
Age: 31
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to add multiple style files

Well Jack maybe when you get into some more advanced projects you'll have the opportunity to see why you might need it.

And since the point of the forum is to give people with less knowledge and experience some advice and pointers I thought it would be useful.
Reply With Quote
  #9 (permalink)  
Old Feb 21st, 2008, 19:15
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: How to add multiple style files

I've done quite a few designs and never used it. If you have and want to use it, thats fine.
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #10 (permalink)  
Old Feb 27th, 2008, 12:14
Reputable Member
Join Date: Mar 2007
Location: Kenya
Age: 19
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to geyids Send a message via Yahoo to geyids Send a message via Skype™ to geyids
Re: How to add multiple style files

I have used the CSS and its working fine. If you visit here you might notice the difference. (not on the logo)
Reply With Quote
  #11 (permalink)  
Old Feb 27th, 2008, 15:44
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to add multiple style files

If you want to use a browser sniffer, by all means use a server-side script rather than javascript.

You could really use almost any server side scripting (or even programming) language, although PHP is the general choice for individuals like yourself.

You could find a canned script easily enough and shouldn't need a vast amount of PHP knowledge to implement it safely, about half an hour of introductory study and then reconfiguring your pages for the "*.php" suffix.

The only real problem you might have is server implementation. I mean, you shouldn't have a problem on most hosts, but if you did, you'd either have to get help or forget it.

The upside is, once you have it implemented, it works like a dream. Cross-browser worries are a thing of the past.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple rollover images change multiple images joshlindem Web Page Design 4 Apr 18th, 2008 09:11
Can multiple domain names point to the same HTML files? classic123 Web Page Design 3 Oct 30th, 2007 15:33
How to tell IE7 to use a pariticular style in a single style sheet figo2476 Web Page Design 5 May 25th, 2007 14:23
uploading multiple files path in the database franknu PHP Forum 4 Jan 23rd, 2007 15:37


All times are GMT. The time now is 07:28.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43