Comments within head area

D

Dung Ping

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

Thanks.
Dung Ping
 
B

Barbara de Zoete

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 |
`-------------------------------------------------- --<--@ ------------'
 
J

Jukka K. Korpela

Dung Ping said:
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.)
 
G

Guillaume

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

the first ones: <!-- -->
 
D

dorayme

From: "Dung Ping said:
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.
 
C

cwdjrxyz

Dung said:
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.
 
R

rf

dorayme said:
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: -->
 
C

cwdjrxyz

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.
 
D

dorayme

From: rf said:
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) said:
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...
 
D

dorayme

From: rf said:

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...
 
D

Dung Ping

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top