SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Do you put all your styles in an external style sheet?

    It makes sense to have all your CSS in one style sheet. I however always end up styling in my html as well. If I repeat a style a lot, I'll put in my external. Otherwise I code in my html as well. A little sloppy I know.

    and you?
    I live in Madison. Where in the W1RLD do you live?

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ALWAYS put all the styles in an external stylesheet - or several external style sheets - just keeps it simpler to maintain for me.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was thikning the same thing today...generally I always put all my styles in an external sheet, but what if the site you are making needs different styles for each page, rather than using a template...

  4. #4
    SitePoint Addict
    Join Date
    Feb 2005
    Location
    Brisbane, Australia
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by znebojsa View Post
    I was thikning the same thing today...generally I always put all my styles in an external sheet, but what if the site you are making needs different styles for each page, rather than using a template...
    Then it would make sense to put all of the CSS for Page X in Page X's external stylesheet, and to put all of the CSS for Page Y in Page Y's external stylesheet. While it means an additional HTTP request, it keeps file sizes down (it shouldn't be much of an issue anyway, unless you have users working on lower speed connections), and with any luck the visitor will cache the CSS file, meaning (hopefully) less bandwidth usage for everyone.

  5. #5
    SitePoint Member Tim.R's Avatar
    Join Date
    Feb 2008
    Location
    Netherlands
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use external stylesheets only, I find it alot easier to maintain a website using external stylesheets.

  6. #6
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by znebojsa View Post
    I was thikning the same thing today...generally I always put all my styles in an external sheet, but what if the site you are making needs different styles for each page, rather than using a template...
    Then I'd give each page a different id (in the body tag) and so you can easily then style the same element differently on different pages without having to resort to inline styles or separate stylesheets.
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mainly external style sheets, but on occasion I can add a style element in the head if there's only some minor thing that's needed for a single page only. I'll also do this to style forms, since there's no two of them that are exactly alike. I'll keep the main rules for fieldsets, labels, etc. in the external style sheet, of course, but things like input widths will vary between forms and I'll stick those in an internal style sheet.
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Enthusiast LadynRed's Avatar
    Join Date
    Sep 2003
    Location
    TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    External style sheets all the way, and generally only one for a site (except for those "iefixes" css files).

  9. #9
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One external stylesheet per medium. And to make it even easier to determine which is which, I'll use the name for that stylesheet as well.

    screen.css
    print.css

    and so on. And any "IE 5/6 fixes" just get put into a separate iefix.css (which does make heavy use of the * html selector hack) file which is imported into the screen.css file saving me the mess of having to deal with conditional comments.

  10. #10
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! I feel so newbie. You all have converted me.
    I live in Madison. Where in the W1RLD do you live?

  11. #11
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    934
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Stylesheets on the page are helpful changing things in includes. (Like bolding navigation for the page your on.) Other than that, alway external.

  12. #12
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually eruna, just adding a class dynamically via a server-side program can take care of that. The external stylesheet could then contain the CSS for that class.


Bookmarks

Posting Permissions

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