Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    268
    Plugin Contributions
    0

    Default 2 Stylesheets, is this needed?

    Afternoon,

    The last company that did some work for me made it so that there's one stylesheet for IE and then another for the rest, is this needed or is it better to just run one for everything?

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: 2 Stylesheets, is this needed?

    Often, an additional stylesheet for IE will help work around IE's CSS bugs, so a properly configured one is good if you need it. Not every site needs special handling for IE.

    This avoids having IE-specific rules active for other, better browsers.

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: 2 Stylesheets, is this needed?

    Quote Originally Posted by DPM View Post
    Afternoon,

    The last company that did some work for me made it so that there's one stylesheet for IE and then another for the rest, is this needed or is it better to just run one for everything?
    Good question, and I note that gjh42 has already mentioned why IE needs special treatment, but to answer your question "is it needed or is it better to run one for everything?" It is my opinion that separate style sheets are better than "one sheet for everything".

    The fact that these are called Cascading Style Sheets (CSS) also suggests that by design there should/could be several of these sheets working together.. Otherwise they'd be called SSS (Single style sheets)

    Having said that, there is no 'rule' that states you MUST have more than one SS, or that they MUST cascade, and many people actually prefer to put everything into a single sheet. Also many performance reporting tools will even suggest that multiple CSS files be combined into a single file.

    The end result will always be the same (all else being equal), so I suggest you use what you are most comfortable with.

    Cheers
    Rod

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: 2 Stylesheets, is this needed?

    A reason to use a separate IE stylesheet is that some rules needed to make IE behave will cause other browsers to misbehave. You need to serve those rules only to IE, or else do very complicated gymnastics to keep other browsers from seeing them.

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: 2 Stylesheets, is this needed?

    Quote Originally Posted by gjh42 View Post
    A reason to use a separate IE stylesheet is that some rules needed to make IE behave will cause other browsers to misbehave. You need to serve those rules only to IE, or else do very complicated gymnastics to keep other browsers from seeing them.
    If you find this to be the case then you probably need to review your knowledge of CSS.

    Cheers
    Rod

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: 2 Stylesheets, is this needed?

    Quote Originally Posted by RodG View Post
    If you find this to be the case then you probably need to review your knowledge of CSS.
    I'll respectfully disagree with that. Many current CSS standards don't work in IE6 or 7, and an additional IE stylesheet seems to be the simplest way to fix that, unless I'm missing something.

  7. #7
    Join Date
    May 2010
    Location
    WA State
    Posts
    1,678
    Plugin Contributions
    3

    Default Re: 2 Stylesheets, is this needed?

    Quote Originally Posted by stevesh View Post
    I'll respectfully disagree with that. Many current CSS standards don't work in IE6 or 7, and an additional IE stylesheet seems to be the simplest way to fix that, unless I'm missing something.
    Honestly, with only 3% to 4% of people still using IE6/IE7 I'm not sure it's worth spending much time worrying about.

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: 2 Stylesheets, is this needed?

    Quote Originally Posted by stevesh View Post
    I'll respectfully disagree with that. Many current CSS standards don't work in IE6 or 7, and an additional IE stylesheet seems to be the simplest way to fix that, unless I'm missing something.
    Who was it that once said, "The nice thing about standards is that there are so many to choose from"

    Anyway, I really don't wish to get into an in-depth discussion about this because it has all been covered a bazzilion times before, and we all have our favourite methods of doing things, so for the most part, what is best comes down to personal opinion.

    As for possibly missing something I really can't comment. The following link provides a 'tip' that I only stumbled across a few months ago.
    http://briancray.com/2009/04/16/targ...r-in-your-css/

    Is this one that you are aware of?

    Needless to say, this now comes back to gjh42's original comment about 'complicated gymnastics', and my current response is now 'define complicated'.

    To me, adding stuff like
    <!--[if IE 6]> <link rel="stylesheet" href="ie6.css" type="text/css" /> <![endif]-->

    To the pages, and creating a whole new stylesheet for any given browser (or browser version)
    is just as complicated as using any of the well known hacks to achieve the same result.

    Anyway, I think between us we have more than adequately answered the OP's question.

    Cheers
    Rod

 

 

Similar Threads

  1. v154 Help still needed on this.
    By dfontana in forum Customization from the Admin
    Replies: 8
    Last Post: 1 Jun 2015, 04:31 AM
  2. v150 URGENT advice needed - is this possible?
    By MelodyW in forum Managing Customers and Orders
    Replies: 3
    Last Post: 27 May 2014, 11:47 PM
  3. Please take a look at this, advice needed.
    By digilime in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Dec 2009, 10:43 AM
  4. Replies: 1
    Last Post: 28 Jun 2009, 08:17 AM
  5. Sherlock Holmes needed for this one - notification error?
    By clane777 in forum General Questions
    Replies: 10
    Last Post: 1 May 2007, 09:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg