Comments within head area

Discussion in 'HTML' started by Dung Ping, Nov 5, 2005.

  1. Dung Ping

    Dung Ping Guest

    I need to place comment tags around some meta elements, those <meta . .
    ..>. Are the tags <!-- -->, or /* */ or //?

    Thanks.
    Dung Ping
     
    Dung Ping, Nov 5, 2005
    #1
    1. Advertising

  2. On Sat, 05 Nov 2005 13:03:44 +0100, Dung Ping <> wrote:

    > I need to place comment tags around some meta elements, those <meta . .
    > .>. Are the tags <!-- -->, or /* */ or //?
    >


    Asuming you use an html variant:
    <http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.4>


    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Nov 5, 2005
    #2
    1. Advertising

  3. "Dung Ping" <> wrote:

    > I need to place comment tags around some meta elements,


    I doubt that. For whom would you write the comments? Why would you put them
    into the page that gets the browsers, perhaps a million times, and not into a
    separate documentation file?

    > those <meta . . .>.


    I have a feeling that there is some exercise in futility in progress.

    > Are the tags <!-- -->, or /* */ or //?


    No.

    If you really must use comments in HTML, write
    <!-- your comment, which must not contain two hyphens in succession -->
    (But there are no tags involved here.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Nov 5, 2005
    #3
  4. Dung Ping

    Guillaume Guest

    Dung Ping:
    > I need to place comment tags around some meta elements, those <meta . .
    > .>. Are the tags <!-- -->, or /* */ or //?


    the first ones: <!-- -->

    --
    My desktop is worth a million of dollars. Put an icon on it.
    http://www.milliondollarscreenshot.com/
     
    Guillaume, Nov 5, 2005
    #4
  5. Dung Ping

    dorayme Guest

    > From: "Dung Ping" <>
    >
    > I need to place comment tags around some meta elements, those <meta . .
    > .>. Are the tags <!-- -->, or /* */ or //?
    >


    Generally, if you are wanting to turn off (so they are ignored
    by browsers) bits of the source, encase all the <!-- bits that
    are to be ignored as you can see here and which can be commented
    inside further, even irrelevantly, (like, for example, don't
    forget Dylan's birthday when I am making my annual check of
    this website, due at roughly the same time) -->

    I notice that Korpela advises on a restriction (don't use "--"
    within). Heed this, though it is unlikely you would naturally
    use it. The restriction would be due, presumably, to its power
    to confuse the scope of what is to be ignored.

    --
    dorayme
     
    dorayme, Nov 5, 2005
    #5
  6. Dung Ping

    Guest

    Dung Ping wrote:
    > I need to place comment tags around some meta elements, those <meta . .
    > .>. Are the tags <!-- -->, or /* */ or //?


    Others have rightly said to use <!-- --> for html comments. The pair /*
    */ is used to enclose multi-line comments within a javascript or CSS
    style sheet. The // often is used just before a javascript comment that
    ends on a single line. Using the wrong types of comments in html,
    script, or CSS sections sometimes causes problems.
     
    , Nov 5, 2005
    #6
  7. Dung Ping

    rf Guest

    dorayme wrote:

    > I notice that Korpela advises on a restriction (don't use "--"
    > within). Heed this, though it is unlikely you would naturally
    > use it. The restriction would be due, presumably, to its power
    > to confuse the scope of what is to be ignored.


    I've seen people split up sections of their HTMl with
    <!--------------------------------------------------------->

    Count the -s :)

    BTW it is not really a "don't use --" rule, it's use them paired:

    <!-- this a comment -- this is not -- this is another comment -- this is
    not and just what will the browser do with the final: -->

    --
    Cheers
    Richard.
     
    rf, Nov 6, 2005
    #7
  8. Dung Ping

    Guest

    wrote:
    > Dung Ping wrote:
    > > I need to place comment tags around some meta elements, those <meta . .
    > > .>. Are the tags <!-- -->, or /* */ or //?

    >
    > Others have rightly said to use <!-- --> for html comments. The pair /*
    > */ is used to enclose multi-line comments within a javascript or CSS
    > style sheet. The // often is used just before a javascript comment that
    > ends on a single line. Using the wrong types of comments in html,
    > script, or CSS sections sometimes causes problems.


    The html-type comment tag <!-- I am a comment. --> also is used in a
    SMIL 2 program that is contained between <smil> and </smil> tags. SMIL
    is an XML language. While most browsers will not support full SMIL 2
    directly, the most recent Real players have nearly complete W3C SMIL 2
    support built in, and add-on programs for SMIL support are available.
    SMIL is a very powerful XML language designed for media presentations.
     
    , Nov 6, 2005
    #8
  9. Dung Ping

    dorayme Guest

    > From: rf <>
    >
    > dorayme wrote:
    >
    >> I notice that Korpela advises on a restriction (don't use "--"
    >> within). Heed this, though it is unlikely you would naturally
    >> use it. The restriction would be due, presumably, to its power
    >> to confuse the scope of what is to be ignored.

    >
    > I've seen people split up sections of their HTMl with
    > <!--------------------------------------------------------->
    >


    <!-- ******************** -->I sometimes do <!--
    ******************** --> or <!-- ***blahblah*** --> but perhaps
    (apart from it's less
    eye-catching look) <!-- ------------ --> would be ok.

    > Count the -s :)
    >
    > BTW it is not really a "don't use --" rule, it's use them paired:
    >


    What does this mean exactly? Use, don't use, pair, spaces,
    schmaces... It's simple enough: if Korpela says something
    narrowly specialised, it is likely to be right. I can't ask him
    of course because we don't click it off down to the DNA level,
    but I take it don't use "--" with spaces on either side is what
    is meant /within/ an intended comment ie. "<!-- " and " -->"

    My brain hurts, rf... :)

    > <!-- this a comment -- this is not -- this is another comment -- this is
    > not and just what will the browser do with the final: -->
    >


    My iCab scowls badly and does not like this... but does not
    actually do anything about it. But that maybe because it is a
    simple test with just your sentence...

    --
    dorayme
     
    dorayme, Nov 6, 2005
    #9
  10. Dung Ping

    rf Guest

    rf, Nov 7, 2005
    #10
  11. Dung Ping

    dorayme Guest

    > From: rf <>

    > dorayme wrote:
    >
    >> My brain hurts, rf... :)

    >
    > http://www.htmlhelp.com/reference/wilbur/misc/comment.html
    >
    > --
    > Cheers
    > Richard.


    This is legal, that is legal, this is illegal, that is illegal,
    but it all does not matter in practice because some or other
    browsers don't take niceties into account...

    It seems I have avoided the whole thing as I roughly outlined
    and as it says in your url at the end:

    "use the following simple rule to compose valid and accepted
    comments:

    An HTML comment begins with "<!--", ends with "-->" and does not
    contain "--" or ">" anywhere in the comment."

    Still, I suppose it is something that one can go into a bit out
    of no practical interest. In some things (like grep pattern
    searches) one escapes characters with a "\" in front. There is
    likely no reliable escaping things like ">" or "<" within
    comments...?

    Suppose I want to say in my source at one point:

    <!-- Crikey! The "<--" at the start of the last comment at line
    40 just winked at me as I typed just now at line number 58 above
    -->

    Ho hum...

    --
    dorayme
     
    dorayme, Nov 7, 2005
    #11
  12. Dung Ping

    Dung Ping Guest

    wrote:
    > Dung Ping wrote:
    > > I need to place comment tags around some meta elements, those <meta . .
    > > .>. Are the tags <!-- -->, or /* */ or //?

    >
    > Others have rightly said to use <!-- --> for html comments. The pair /*
    > */ is used to enclose multi-line comments within a javascript or CSS
    > style sheet. The // often is used just before a javascript comment that
    > ends on a single line. Using the wrong types of comments in html,
    > script, or CSS sections sometimes causes problems.


    Thank all for teaching.

    Dung Ping
     
    Dung Ping, Nov 11, 2005
    #12
    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. Brian W
    Replies:
    10
    Views:
    785
    Brian W
    Jul 2, 2003
  2. showme

    PHP and ASP.NET go HEAD to HEAD

    showme, Jul 8, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    738
    Sherif ElMetainy
    Jul 10, 2004
  3. Karl
    Replies:
    0
    Views:
    404
  4. Mark
    Replies:
    1
    Views:
    610
    Larry Barowski
    Jun 27, 2005
  5. Jiho Han

    Write into <HEAD></HEAD> section?

    Jiho Han, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    240
    Sam Fields
    Jan 16, 2004
Loading...

Share This Page