Combining stylesheets (or not)

Discussion in 'HTML' started by Jim Scott, Apr 29, 2005.

  1. Jim Scott

    Jim Scott Guest

    I have recently converted my site to using stylesheets.
    I use five. One is concerned with buttons and refers to most pages. The
    others relate to table layout. The main one of these refers to every page
    and the others, when I need a different size or border.
    Is there any virtue in combining them in to one master stylesheet?
    If the answer is yes, is it as easy as just putting all the bits together?
    --
    Jim on Tyneside UK
    Remove X to email me.
    http://freespace.virgin.net/mr.jimscott/
    Jim Scott, Apr 29, 2005
    #1
    1. Advertising

  2. Jim Scott wrote:

    > I have recently converted my site to using stylesheets.
    > I use five. One is concerned with buttons and refers to most pages. The
    > others relate to table layout. The main one of these refers to every page
    > and the others, when I need a different size or border.
    > Is there any virtue in combining them in to one master stylesheet?
    > If the answer is yes, is it as easy as just putting all the bits together?


    ===
    Pros of separating:

    Fragmented -> Easier to change locally, without affecting many other
    elements
    Fragmented -> Can be difficult to manage
    Where only few sheets are used, bandwidth is lower

    ===
    Cons of separating:

    More files -> slower to download
    More files -> scattered code
    Alternative stylesheets might be hard to manage


    I suggest you carefully think /how/ stylesheets should be separated. It will
    be tedious to change in the future. I sometimes embed CSS in the HTML files
    to avoid the "change in one affects another".

    Roy

    --
    Roy S. Schestowitz
    http://Schestowitz.com
    Roy Schestowitz, Apr 29, 2005
    #2
    1. Advertising

  3. Jim Scott

    Jim Scott Guest

    On Fri, 29 Apr 2005 10:18:00 +0100, Roy Schestowitz wrote:

    > Jim Scott wrote:
    >
    >> I have recently converted my site to using stylesheets.
    >> I use five. One is concerned with buttons and refers to most pages. The
    >> others relate to table layout. The main one of these refers to every page
    >> and the others, when I need a different size or border.
    >> Is there any virtue in combining them in to one master stylesheet?
    >> If the answer is yes, is it as easy as just putting all the bits together?

    >
    > ===
    > Pros of separating:
    >
    > Fragmented -> Easier to change locally, without affecting many other
    > elements
    > Fragmented -> Can be difficult to manage
    > Where only few sheets are used, bandwidth is lower
    >
    > ===
    > Cons of separating:
    >
    > More files -> slower to download
    > More files -> scattered code
    > Alternative stylesheets might be hard to manage
    >
    >
    > I suggest you carefully think /how/ stylesheets should be separated. It will
    > be tedious to change in the future. I sometimes embed CSS in the HTML files
    > to avoid the "change in one affects another".
    >
    > Roy


    Thanks.
    I could possible reduce the external ss to two, and include the 'table
    tweakers' in the html.
    --
    Jim on Tyneside UK
    Remove X to email me.
    http://freespace.virgin.net/mr.jimscott/
    Jim Scott, Apr 29, 2005
    #3
  4. Jim Scott

    Nico Schuyt Guest

    Jim Scott wrote:
    > Roy Schestowitz wrote:
    >> Jim Scott wrote:


    >>> I have recently converted my site to using stylesheets.
    >>> I use five. One is concerned with buttons and refers to most pages.
    >>> The others relate to table layout. The main one of these refers to
    >>> every page and the others, when I need a different size or border.
    >>> Is there any virtue in combining them in to one master stylesheet?
    >>> If the answer is yes, is it as easy as just putting all the bits
    >>> together?


    >> I suggest you carefully think /how/ stylesheets should be separated.
    >> It will be tedious to change in the future. I sometimes embed CSS in
    >> the HTML files to avoid the "change in one affects another".


    > Thanks.
    > I could possible reduce the external ss to two, and include the 'table
    > tweakers' in the html.


    You *always* need at least two stylesheets. One for the displaying on screen
    and one for printing.
    Like Roy I put all the markup in the external stylesheet and if it's
    specific for one file in the page itself.

    --
    Nico
    http://www.nicoschuyt.nl
    Nico Schuyt, Apr 30, 2005
    #4
  5. Jim Scott

    Andy Dingley Guest

    On Sat, 30 Apr 2005 09:58:11 +0200, "Nico Schuyt" <>
    wrote:

    >You *always* need at least two stylesheets. One for the displaying on screen
    >and one for printing.


    You can also do this within one stylesheet. Use @media print {} inside
    the stylesheet itself. That way you still only need a single <link> on
    each page and you can manipulate the stylesheet's behaviour for a whole
    site for changing one centralised CSS location, not each page.

    --
    Cats have nine lives, which is why they rarely post to Usenet.
    Andy Dingley, Apr 30, 2005
    #5
  6. Jim Scott

    Nico Schuyt Guest

    Andy Dingley wrote:
    > On Sat, 30 Apr 2005 09:58:11 +0200, "Nico Schuyt"
    > <> wrote:


    >> You *always* need at least two stylesheets. One for the displaying
    >> on screen and one for printing.


    > You can also do this within one stylesheet. Use @media print {}
    > inside the stylesheet itself.


    How is browser support of that?

    --
    Nico
    http://www.nicoschuyt.nl
    Nico Schuyt, Apr 30, 2005
    #6
  7. Jim Scott

    Toby Inkster Guest

    Nico Schuyt wrote:
    > Andy Dingley wrote:
    >
    >> You can also do this within one stylesheet. Use @media print {}
    >> inside the stylesheet itself.

    >
    > How is browser support of that?


    Fine thanks. Unless you're worried about IE 3 and Netscape 4.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Apr 30, 2005
    #7
  8. Jim Scott

    Andy Dingley Guest

    On Sat, 30 Apr 2005 15:30:32 +0200, "Nico Schuyt" <>
    wrote:

    >How is browser support of that?


    Good enough. It's the level of feature where I want the mainstream
    browsers to behave with it, but I can leave with the really obscure ones
    breaking it.



    --
    Cats have nine lives, which is why they rarely post to Usenet.
    Andy Dingley, Apr 30, 2005
    #8
  9. Jim Scott

    Nico Schuyt Guest

    Andy Dingley wrote:
    > Nico Schuyt wrote:


    >> > Use @media print {}


    >> How is browser support of that?


    > Good enough. It's the level of feature where I want the mainstream
    > browsers to behave with it, but I can leave with the really obscure
    > ones breaking it.


    Thanks

    --
    Nico
    http://www.nicoschuyt.nl
    Nico Schuyt, Apr 30, 2005
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adrian

    Changing stylesheets

    Adrian, Oct 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    Esteban Felipe
    Oct 27, 2003
  2. ADRIAN

    Changeing Stylesheets

    ADRIAN, Nov 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    355
    ADRIAN
    Nov 5, 2003
  3. Rod  Snyder
    Replies:
    3
    Views:
    2,592
    =?Utf-8?B?RGF2aWQgQ29l?=
    Feb 2, 2004
  4. =?Utf-8?B?QW5kcmU=?=

    Stylesheets are not followed after migration

    =?Utf-8?B?QW5kcmU=?=, Mar 30, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    366
    Gerry Hickman
    Apr 13, 2006
  5. Thomas 'PointedEars' Lahn
    Replies:
    0
    Views:
    121
    Thomas 'PointedEars' Lahn
    May 1, 2004
Loading...

Share This Page