Where should small amount of page specific style go?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Cunningham

    Where should small amount of page specific style go?

    I am curious if there is something that would be considered a proper
    method for locating small (three to four items) amounts of page specific
    styling. Or does it really matter in the great scheme of things?

    I have a linked style sheet that covers everything I want to do
    globally. What should be done if I want to change and/or add a couple of
    divs and paragraphs on a specific page and the style applied is specific
    to that one page?

    Should this be placed on a separate linked style sheet, placed in the
    global style sheet (considering that I may be modifying something that
    has already been declared like a paragraph), or would it be considered
    ok to simply have this page specific styling on the web page itself
    since it is specific to that one page?

    Mark


  • Stan Brown

    #2
    Re: Where should small amount of page specific style go?

    In article <3EFDE507.30309 @netscape.net> in
    comp.infosystem s.www.authoring.stylesheets, Mark Cunningham
    <macunni@netsca pe.net> wrote:[color=blue]
    >I am curious if there is something that would be considered a proper
    >method for locating small (three to four items) amounts of page specific
    >styling. Or does it really matter in the great scheme of things?[/color]

    I'm sure I'll have to dodge some brickbats, but if you have styles
    that _really_ only apply to on document, I don't see great harm in
    putting them in a <style> element.

    However...

    Even if today you're 100% certain that they will never apply to any
    other document, I'll bet in a surprisingly short time you'll find
    you do need them in a second document, and you'll wish they had been
    in an external stylesheet all along. If their use is truly rare, you
    could keep them in a special sheet, have that special sheet import
    the main one, and then have your unusual document link to the
    special sheet instead of the main one.

    --
    Stan Brown, Oak Road Systems, Cortland County, New York, USA
    Dragon222 adalah situs slot gacor terbaru yang selalu memberikan banyak bonus menarik dan kemenangan JP untuk pemain setia selama bermain di link slot DRAGON222.

    HTML 4.01 spec: http://www.w3.org/TR/html401/
    validator: http://validator.w3.org/
    CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
    validator: http://jigsaw.w3.org/css-validator/

    Comment

    • Stephen Poley

      #3
      Re: Where should small amount of page specific style go?

      On Sat, 28 Jun 2003 20:03:27 -0400, Stan Brown
      <the_stan_brown @fastmail.fm> wrote:
      [color=blue]
      >In article <3EFDE507.30309 @netscape.net> in
      >comp.infosyste ms.www.authoring.stylesheets, Mark Cunningham
      ><macunni@netsc ape.net> wrote:[color=green]
      >>I am curious if there is something that would be considered a proper
      >>method for locating small (three to four items) amounts of page specific
      >>styling. Or does it really matter in the great scheme of things?[/color][/color]
      [color=blue]
      >I'm sure I'll have to dodge some brickbats, but if you have styles
      >that _really_ only apply to on document, I don't see great harm in
      >putting them in a <style> element.[/color]

      Agreed - I often do that.
      [color=blue]
      >However...
      >
      >Even if today you're 100% certain that they will never apply to any
      >other document, I'll bet in a surprisingly short time you'll find
      >you do need them in a second document, and you'll wish they had been
      >in an external stylesheet all along. If their use is truly rare, you
      >could keep them in a special sheet, have that special sheet import
      >the main one, and then have your unusual document link to the
      >special sheet instead of the main one.[/color]

      On the other hand (a) if you have several pages with unique styles, that
      introduces several extra files; (b) it's not that much work to move the
      in-page styles to a separate stylesheet later if they become needed on a
      second page.

      Sometimes I use in-page styles for something like tweaking a margin
      where, even if I did exactly the same thing on another page, I wouldn't
      necessarily want a change to one page to affect other pages elsewhere.

      --
      Stephen Poley


      Comment

      • Jacqui or (maybe) Pete

        #4
        Re: Where should small amount of page specific style go?

        In article <3EFDE507.30309 @netscape.net>, macunni@netscap e.net says...[color=blue]
        > I am curious if there is something that would be considered a proper
        > method for locating small (three to four items) amounts of page specific
        > styling. Or does it really matter in the great scheme of things?
        >
        > I have a linked style sheet that covers everything I want to do
        > globally. What should be done if I want to change and/or add a couple of
        > divs and paragraphs on a specific page and the style applied is specific
        > to that one page?
        >[/color]
        One option is to add an id to the body element of the specific page and
        use eg :

        #specialOne p {
        ... stuff specific to #specialOne page
        }

        Which makes life easy when you want to use that style in another page.

        Comment

        • Jim Dabell

          #5
          Re: Where should small amount of page specific style go?

          Mark Cunningham wrote:
          [color=blue]
          > I am curious if there is something that would be considered a proper
          > method for locating small (three to four items) amounts of page specific
          > styling. Or does it really matter in the great scheme of things?[/color]

          It depends on how much of this you are expecting to do, and how visited the
          pages are compared with the rest of the site. If there's just a few rules
          here and there, then I'd just put them in the global stylesheet. It would
          be a matter of 1K or so download for each visitor on the initial pageview,
          and nothing from that point on, as opposed to a guaranteed 1K every time
          somebody retrieves one of the pages from your server (the 1K is a complete
          guess of course, but the principle holds, at least for small values).


          --
          Jim Dabell

          Comment

          • Matthias Gutfeldt

            #6
            Re: Where should small amount of page specific style go?

            Mark Cunningham schrieb:[color=blue]
            >
            > I am curious if there is something that would be considered a proper
            > method for locating small (three to four items) amounts of page specific
            > styling. Or does it really matter in the great scheme of things?
            >
            > I have a linked style sheet that covers everything I want to do
            > globally. What should be done if I want to change and/or add a couple of
            > divs and paragraphs on a specific page and the style applied is specific
            > to that one page?
            >
            > Should this be placed on a separate linked style sheet, placed in the
            > global style sheet (considering that I may be modifying something that
            > has already been declared like a paragraph), or would it be considered
            > ok to simply have this page specific styling on the web page itself
            > since it is specific to that one page?[/color]

            Most "page specific" styles turn out to be useful for other pages too,
            while you'll find that some global styles really only apply to a few
            pages. If you follow the route of "page-specific styles directly in the
            web page", you could end up moving styles back and forth between
            individual pages and the global stylesheet - time-intensive,
            complicated, and error-prone.

            And those page-specific styles in their individual page are usually
            forgotten pretty soon; they'll rear their ugly head when you're updating
            your global stylesheet and wonder about all the weird things that are
            happening on some pages.

            The same goes for linked stylesheets: You could end up with a css folder
            full of different files that control some aspect of some pages but not
            other aspects of some other pages - one big confusing mess.

            That's why I usually suggest putting it all in one global stylesheet,
            with lots of documentation to it. Properly organized sites can probably
            risk separate linked stylesheets for separate sections of the site, but
            even with good organization the potential for a big mess is just a
            <link> away.

            Whatever you do, try not to have too many different sources for the
            final style rule - the cascade is a big pain in the tuckus, and
            sometimes hard to understand for both authors and browsers.


            Matthias

            Comment

            • Mark Cunningham

              #7
              Re: Where should small amount of page specific style go?

              Matthias Gutfeldt wrote:[color=blue]
              > Mark Cunningham schrieb:
              >[color=green]
              >>I am curious if there is something that would be considered a proper
              >>method for locating small (three to four items) amounts of page specific
              >>styling. Or does it really matter in the great scheme of things?
              >>
              >>I have a linked style sheet that covers everything I want to do
              >>globally. What should be done if I want to change and/or add a couple of
              >>divs and paragraphs on a specific page and the style applied is specific
              >>to that one page?
              >>
              >>Should this be placed on a separate linked style sheet, placed in the
              >>global style sheet (considering that I may be modifying something that
              >>has already been declared like a paragraph), or would it be considered
              >>ok to simply have this page specific styling on the web page itself
              >>since it is specific to that one page?[/color]
              >
              >
              > Most "page specific" styles turn out to be useful for other pages too,
              > while you'll find that some global styles really only apply to a few
              > pages. If you follow the route of "page-specific styles directly in the
              > web page", you could end up moving styles back and forth between
              > individual pages and the global stylesheet - time-intensive,
              > complicated, and error-prone.
              >
              > And those page-specific styles in their individual page are usually
              > forgotten pretty soon; they'll rear their ugly head when you're updating
              > your global stylesheet and wonder about all the weird things that are
              > happening on some pages.
              >
              > The same goes for linked stylesheets: You could end up with a css folder
              > full of different files that control some aspect of some pages but not
              > other aspects of some other pages - one big confusing mess.
              >
              > That's why I usually suggest putting it all in one global stylesheet,
              > with lots of documentation to it. Properly organized sites can probably
              > risk separate linked stylesheets for separate sections of the site, but
              > even with good organization the potential for a big mess is just a
              > <link> away.
              >
              > Whatever you do, try not to have too many different sources for the
              > final style rule - the cascade is a big pain in the tuckus, and
              > sometimes hard to understand for both authors and browsers.
              >
              >
              > Matthias[/color]

              Matthias, Jim Dabell, Jacqui or (maybe) Pete, Stephen Poley, Stan Brown,
              many thanks for taking the time to respond. It is greatly appreciated.
              Sound advice and food for thought.

              --

              Mark Cunningham


              Comment

              Working...