External CSS and HTML 2.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guy Macon

    External CSS and HTML 2.0




    I have been running tests on various doctypes and
    found something interesting.

    I set up a test page using this doctype...

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN">

    ....and put this in the head:

    <link rel="stylesheet " type="text/css" href="http://www.example.com/test.css">

    The page failed the W3C validator. Changing the above to...

    <link rel="stylesheet " href="http://www.example.com/test.css">

    ....allowed the page to validate.

    I already tell the browser what type of document test.css
    is in my .htaccess file:

    AddType 'text/css; charset=US-ASCII' .css
    AddCharset US-ASCII .css
    AddLanguage en-US .css

    I repeated the test with HTML 4.01 strict and XHTML 1.1
    pages (making the other changes needed) and it still validated.

    Other than the usual Internet Explorer choking on XHTML 1.1
    served as application/xhtml+xml, the HTML 2.0, HTML 4.01 strict
    and the XHTML 1.1 test pages are all following the directives
    in the CSS file just fine. The only quirk I found was that the
    W3C CSS Validator couldn't find the CSS from the HTML/XHTML
    file (but it validated when I pointed it at the CSS file).

    Is there any good reason why that type="text/css" is found
    in every example of using an extenal CSS that I can find?








    -
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>


  • John Hosking

    #2
    Re: External CSS and HTML 2.0

    Guy Macon wrote:
    I have been running tests on various doctypes and
    found something interesting.
    >
    I set up a test page using this doctype...
    >
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN">
    >
    ...and put this in the head:
    >
    <link rel="stylesheet " type="text/css" href="http://www.example.com/test.css">
    >
    The page failed the W3C validator.
    Because HTML 2.0 didn't support the type attribute. No problem there, right?

    Changing the above to...
    >
    <link rel="stylesheet " href="http://www.example.com/test.css">
    >
    ...allowed the page to validate.
    Sure.
    >
    I already tell the browser what type of document test.css
    is in my .htaccess file:
    >
    AddType 'text/css; charset=US-ASCII' .css
    AddCharset US-ASCII .css
    AddLanguage en-US .css
    Fascinating, perhaps, but wholly unrelated to HTML validity.
    >
    I repeated the test with HTML 4.01 strict and XHTML 1.1
    pages (making the other changes needed) and it still validated.
    The type="text/css" is required for embedded style information as per
    http://www.w3.org/TR/html401/present....html#h-14.2.3. For external
    style sheets, the requirement is not so clear, but perhaps you will be
    satisfied with the text (second bulleted item) at
    http://www.w3.org/TR/html401/present...fying-external ,
    in case you haven't read it already?

    "This allows the user agent to avoid downloading a style sheet for an
    unsupported style sheet language."

    I have no idea what other languages a stzle sheet might be in. Klingon?
    [...]
    Is there any good reason why that type="text/css" is found
    in every example of using an extenal CSS that I can find?
    >
    >
    -
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
    >
    >
    You know, this really annoys me every time I see you do it.


    --
    John
    Trying to be a nice guy, if I may use that expression.

    Comment

    • dorayme

      #3
      Re: External CSS and HTML 2.0

      In article <48893f4c$1_7@n ews.bluewin.ch> ,
      John Hosking <John@DELETE.Ho sking.name.INVA LIDwrote:
      Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
      Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
      Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
      Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
      >
      You know, this really annoys me every time I see you do it.
      Me too but in addition, put it down to bias, I would be as annoyed if he
      didn't.

      --
      dorayme

      Comment

      • Guy Macon

        #4
        Re: External CSS and HTML 2.0




        John Hosking wrote:
        >
        >Guy Macon <http://www.GuyMacon.co m/wrote:
        >
        >I already tell the browser what type of document test.css
        >is in my .htaccess file:
        >>
        > AddType 'text/css; charset=US-ASCII' .css
        > AddCharset US-ASCII .css
        > AddLanguage en-US .css
        >
        >Fascinating, perhaps, but wholly unrelated to HTML validity.

        I believe that it is related to HTML validity. From:


        |
        |Authors must specify the style sheet language of style
        |information associated with an HTML document.
        |
        |...
        |
        |The default style sheet language may also be set with HTTP
        |headers. The above META declaration is equivalent to the
        |HTTP header:
        |
        |Content-Style-Type: text/css
        |

        ....which is, of course what putting

        AddType 'text/css; .css

        in the .htaccess file does on Apache servers.

        My take on this (and, it seems, the take of the authors of the
        DTD that the w3C HTML Validator uses for HTML 4.01 Strict) is
        that the requirement is to specify that the style sheet is
        text/css before the browser downloads it. This can be (and
        usually is) done with [ type="text/css" ] in the link in the
        HTML docoment that calls the external style sheet, but it looks
        tp me that specifing that the style sheet is text/css by serving
        the stylesheet with a [ Content-Style-Type: text/css ] HTTP
        header is also valid.





        --

        Microsoft Windows has detected an outdated internal organ.

        The Microsoft Transplant Wizard is preparing your body
        for the installation of a new kidney. Please wait...

        Do you wish to make a backup copy of your existing kidney? [Y/N]

        Installing kidney...10...2 0...30...40...5 0...60...70...

        "ERROR 31337: Insufficient space
        in abdominal cavity. Delete liver
        to create additional organ space?"

        [OK]


        Comment

        • Andy Dingley

          #5
          Re: External CSS and HTML 2.0

          On 25 Jul, 07:06, Guy Macon <http://www.GuyMacon.co m/wrote:
          John Hosking wrote:
          Fascinating, perhaps, but wholly unrelated to HTML validity.
          >
          I believe that it is related to HTML validity. From:http://www.w3.org/TR/html401/present....html#h-14.2.1
          Why does a W3C rec for HTML _4.01_ influence what's valid in HTML
          _2.0_ ?

          Comment

          • Travis Newbury

            #6
            Re: External CSS and HTML 2.0

            On Jul 24, 11:06 pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
            You know, this really annoys me every time I see you do it.
            Me too but in addition, put it down to bias, I would be as annoyed if he
            didn't.

            Man I guess my new thing is not going to please you either... But
            mine is more an experiment.
            --
            Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
            Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
            Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
            Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap

            Comment

            • Jukka K. Korpela

              #7
              Re: External CSS and HTML 2.0

              Scripsit Guy Macon:
              --
              (This .sig is best displayed with a non-proportional
              monotype font such as Courier with word wrap disabled)
              You were already warned about irritating sigs, and you are just making
              them worse. This seems to be consistent with the lack of relevant
              content and the presence of chaotic structure in your messages proper.

              Thank you for making it clear that your future postings should be
              ignored. Please keep using the same forged From field until you have a
              clue. Thank you in advance.

              --
              Jukka K. Korpela ("Yucca")


              Comment

              • John Hosking

                #8
                Re: External CSS and HTML 2.0

                Guy Macon wrote:
                John Hosking wrote:
                >Guy Macon wrote:
                >>
                >>I already tell the browser what type of document test.css
                >>is in my .htaccess file:
                >>>
                >> AddType 'text/css; charset=US-ASCII' .css
                >> AddCharset US-ASCII .css
                >> AddLanguage en-US .css
                >Fascinating, perhaps, but wholly unrelated to HTML validity.
                >
                >
                I believe that it is related to HTML validity. From:

                >
                |
                |Authors must specify the style sheet language of style
                |information associated with an HTML document.
                |
                |...
                |
                |The default style sheet language may also be set with HTTP
                |headers. The above META declaration is equivalent to the
                |HTTP header:
                |
                |Content-Style-Type: text/css
                |
                Okay, I see your point. I was trying to say that the HTML itself is
                unaware what might be in the .htaccess file and doesn't know or care
                even what headers are sent. The HMTL parser has to know the encoding of
                the HTML document, but won't otherwise care about headers or Apache
                configurations. The CSS file has to be locatable and readable when it
                comes time to *render*, but the HTML and its parsing are separate.

                But I see that the W3C doc you point to has a bit of a leak in it.
                Ostensibly describing what's in an HTML document and what it means, it
                starts pointing outside the document at HTTP headers (and their
                lieutenants, the META declarations).

                So whatever the limitations of the validator[1], if you've declared a
                default style sheet language[2] via any legal method, you're in good shape.

                [1] Did you say you got valid results for HTML 4.01 strict served
                without the [ type="text/css" ] in the link and without the [ AddType
                'text/css; .css ] in the .htaccess file? That is, without *any*
                declaration of the type?

                [2] 'Ts hardly a language, is it?
                >
                ...
                --
                Thanks for fixing your delimiter. I had to do some work to quote your
                sig. :-)
                >
                Microsoft Windows has detected an outdated internal organ.
                >
                The Microsoft Transplant Wizard is preparing your body
                for the installation of a new kidney. Please wait...
                >
                Do you wish to make a backup copy of your existing kidney? [Y/N]
                >
                Installing kidney...10...2 0...30...40...5 0...60...70...
                >
                "ERROR 31337: Insufficient space
                in abdominal cavity. Delete liver
                to create additional organ space?"
                >
                [OK]
                Longer, but funnier. From my experience, I'd expect that when one clicks
                "OK", another dialog comes up that says

                Deleting liver can cause problems and lead to system instability.
                Are you sure you want to delete liver, or do you want to abort the
                deletion (recommended)?

                [Yes] [No] [Cancel]

                --
                John
                My funny .sig is in the shop for maintenance.

                Comment

                • The Troll Whisperer

                  #9
                  Re: External CSS and HTML 2.0




                  "Jukka K. Korpela" <jkorpela@cs.tu t.fiwrote:
                  >You were already warned about irritating sigs, and you are just making
                  >them worse. This seems to be consistent with the lack of relevant
                  >content and the presence of chaotic structure in your messages proper.
                  >
                  >Thank you for making it clear that your future postings should be
                  >ignored. Please keep using the same forged From field until you have a
                  >clue. Thank you in advance.
                  That time of month, is it?

                  Here's a dime, Jukka; go buy yourself a *real* newsreader. One that can be
                  configured to not display sigs that are proberly delimited with the pattern
                  "-- " on a line by itself.
                  >X-Newsreader: Microsoft Outlook Express
                  What an idiot you are. Using the worst possible news reader and then flaming
                  others because it cannot trim sigs. Moron.

                  Comment

                  • Scott Bryce

                    #10
                    Re: External CSS and HTML 2.0

                    Travis Newbury wrote:
                    >>Guy Macon <http://www.GuyMacon.co m/wrote:
                    >--
                    >(This .sig is best displayed with a non-proportional
                    >monotype font such as Courier with word wrap disabled)
                    >>
                    > # # # ####### ####### ####### ## # # # # # # # # ##### # # # # # # ##### ##### ##### # # ##### ##### # # #
                    > # # # # # # # ## # # # # # # # # # # # # # # ## ## # # # # # # ## # # # # # ## ## #
                    > # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
                    ># ####### # # ####### # # # # # # # # # # # # ### # # # # # # ####### # # # # # # # # # # # # #
                    > # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
                    > # # # # # # ## # # ## ## ## ## ## ## ## # # # # # # # # # # # # # # ## ## # # # # # # #
                    > # # # # # # ## # # # # # # # # ## ##### ##### # # # # # ##### ##### # # ## ##### ##### # # #
                    >
                    Well that looks like hell...

                    He forgot the "Best viewed on a 24 inch monitor with your newsreader
                    maximized" disclaimer.

                    Comment

                    • Ed Jay

                      #11
                      Re: External CSS and HTML 2.0

                      The Troll Whisperer <Troll,Whispere r@TrollTech.inv alidwrote:
                      >
                      >
                      >
                      >"Jukka K. Korpela" <jkorpela@cs.tu t.fiwrote:
                      >
                      >>You were already warned about irritating sigs, and you are just making
                      >>them worse. This seems to be consistent with the lack of relevant
                      >>content and the presence of chaotic structure in your messages proper.
                      >>
                      >>Thank you for making it clear that your future postings should be
                      >>ignored. Please keep using the same forged From field until you have a
                      >>clue. Thank you in advance.
                      >
                      >That time of month, is it?
                      >
                      >Here's a dime, Jukka; go buy yourself a *real* newsreader. One that can be
                      >configured to not display sigs that are proberly delimited with the pattern
                      >"-- " on a line by itself.
                      >
                      >>X-Newsreader: Microsoft Outlook Express
                      >
                      >What an idiot you are. Using the worst possible news reader and then flaming
                      >others because it cannot trim sigs. Moron.
                      I guess I must be the idiot...my newsreader, Agent, displays sigs after '--
                      ' unless, like all newsreaders, I'm responding to the message with the sig.
                      Wait...that's what it's supposed to do. It's not supposed to tamper with or
                      edit the incoming message. Oops! I called the wrong guy an idiot. ;-)

                      --
                      Ed Jay (remove 'M' to reply by email)

                      Win the War Against Breast Cancer.
                      Knowing the facts could save your life.

                      Comment

                      • Guy Macon

                        #12
                        Re: External CSS and HTML 2.0




                        The Troll Whisperer wrote:
                        >Here's a dime, Jukka; go buy yourself a *real* newsreader. One that can be
                        >configured to not display sigs that are proberly delimited with the pattern
                        >"-- " on a line by itself.
                        >
                        >>X-Newsreader: Microsoft Outlook Express
                        >
                        >What an idiot you are. Using the worst possible news reader and then flaming
                        >others because it cannot trim sigs. Moron.
                        To be fair, I did fail to have the proper "-- " delimiter on at least
                        one post -- a typo when I cut and pasted. Sorry about that.

                        I do agree, however, that those who object strongly to certain sigs
                        (and who lack the sense of humor to recognize the difference between
                        a regular sig and a one-time intentonal flouting of the rules in an
                        attempt at lighthearted humor) would be well-advised to drop Microsoft
                        Outlook Express and get a newsreader that has the option to not
                        display sigs.




                        --

                        Note to the humor impaired; Long sig used as a joke during
                        a discussion of long sigs. Normal sig will terurn soon.


                        ASCII-art stereograms:

                        Here are two ASCII stereograms. View with a monospace font.
                        To see the 3d effect, you need to focus your eyes such that
                        the two adjacent "X" characters at the top look like three.
                        Once you've done that, wait a few moments for your eyes to
                        get used to it, then slowly look down at the rest of the image.
                        Sometimes it helps to print out the pattern and look at that.





                        X X
                        .. . . . . . . . . . . . . . . . . . . . . . .
                        . . . . . . . . . . . . . . . . .
                        . . . . . . . . . . . . .
                        . . . . . . . . . . .
                        . . . . . . . . .
                        . . . . . . . . .
                        . . . . . . .
                        . . . . . . .
                        .. . . . . . .
                        | | | | | | |
                        | | | | | | |
                        | | | | | | |
                        | | | | | | |
                        | | | | | | |
                        | | | | | | |
                        . . . . . . .
                        . . . . . . .
                        . . . . . . . . .
                        . . . . . . . . .
                        . . . . . . . . . . .
                        . . . . . . . . . . . . .
                        . . . . . . . . . . . . . . . . .
                        .. . . . . . . . . . . . . . . . . . . . . . .





                        X X

                        h h h h h h h h h h h h h h h h h h
                        t t t t t t t t t t t t t t t t
                        t t t t t t t t t t t t t t t t t t
                        p p p p p p p p p p p p p p t t
                        : : : : : : : : : : : : : : : : : :
                        / / / / / / / / / / / / / / / /
                        / / / / / / / / / / / / / / / / /
                        w w w w w w w w w w w w w w w
                        w w w w w w w w w w w w w w w w w
                        w w w w w w w w w w w w w w w
                        . . . . . . . . . . . . . . . . .
                        g g g g g g g g g g g g g g g g
                        u u u u u u u u u u u u u u u u u u
                        y y y y y y y y y y y y y y y y
                        m m m m m m m m m m m m m m m m m m
                        a a a a a a a a a a a a a a a a
                        c c c c c c c c c c c c c c c c c c
                        o o o o o o o o o o o o o o o o
                        n n n n n n n n n n n n n n n n n n
                        . . . . . . . . . . . . . . .
                        c c c c c c c c c c c c c c c c c
                        o o o o o o o o o o o o o o o
                        m m m m m m m m m m m m m m m m m
                        / / / / / / / / / / / / / / /


                        Comment

                        • Ed Mullen

                          #13
                          Re: External CSS and HTML 2.0

                          Guy Macon wrote:

                          What in God's name prompted you to post /that/ sig? I don't care if my
                          news reader stripped it out in my reply, it was still there in your
                          post! Yuck! And pointless eye abuse. Don't care about bandwidth but
                          some surely do. Are you just trying to be annoying? It doesn't matter
                          what you said *above* the sig, the sig makes you look ignorant, or at
                          least attempting to be provocative for no purpose. I used to actually
                          read your posts. Now I'm just skimming over and past them. Re-think
                          your strategy, Guy.

                          --
                          Ed Mullen
                          Help for Mozilla, Firefox and SeaMonkey. Performances and original music.

                          Why do you need a driver's license to buy alcohol when you can't drink
                          and drive?

                          Comment

                          • Guy Macon

                            #14
                            Re: External CSS and HTML 2.0




                            Ed Mullen wrote:
                            >What in God's name prompted you to post /that/ sig? I don't care if my
                            >news reader stripped it out in my reply, it was still there in your
                            >post! Yuck! And pointless eye abuse.
                            A good newsreader will give you the option of stripping out .sigs
                            before displaying posts to the reader. This is an especially
                            valuable option for those who are easily annoyed by .sigs.
                            >Don't care about bandwidth but
                            >some surely do. Are you just trying to be annoying? It doesn't matter
                            >what you said *above* the sig, the sig makes you look ignorant, or at
                            >least attempting to be provocative for no purpose. I used to actually
                            >read your posts. Now I'm just skimming over and past them. Re-think
                            >your strategy, Guy.
                            It was a one-time attempt at humor. Sorry that you didn't find it funny.

                            If you decide to ignore the content of my posts because one joke fell
                            flat for you, all I can say is that, in my opinion, you will be missing
                            a lot of useful information that has sigs that stay under the recognized
                            4-line 79 character limit. It's your choice, though.

                            --
                            Guy Macon
                            <http://www.GuyMacon.co m/>

                            Comment

                            • Gus Richter

                              #15
                              Re: External CSS and HTML 2.0

                              Guy Macon wrote:
                              >
                              A good newsreader will give you the option of stripping out .sigs
                              before displaying posts to the reader. This is an especially
                              valuable option for those who are easily annoyed by .sigs.
                              You've got it wrong there. The sig is only stripped out when replying.

                              If it worked as you suggest, there would be no point in including a sig
                              since nobody would see it and there would be no need to strip it when
                              replying since it had already been stripped on receiving.

                              --
                              Gus

                              Comment

                              Working...