l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 5: Social gathering
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2001 Dec 30 17:14

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] dumb html question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] dumb html question



On Thu, Dec 13, 2001 at 01:08:17PM -0800, Matt Roper wrote:
> I seem to recall that CSS (and JavaScript also) have two comment
> markers:  "<!--" and "//".  Both of these markers are only active until
> the end of the line, the same way "#" works in shell scripts.

"//" works that way, not "<!--".  Also, technically, neither CSS nor
JavaScript use "<!--" - that's an SGML/XML comment.  It would not be
recognized in standalone JavaScript or CSS documents.

> I think the problem with your first example is that <!-- kills
> everything on its line, so your STYLE tag really is empty (it only
> contains a comment).  The problem with the second example is that
> "-->" has no meaning in CSS (it isn't an end of comment marker like
> it is in HTML) so the ">" at the end is getting interpreted
> strangely.
>
> What you want is:
> 
> <STYLE type="text/css">
>     <!--
>     H1 {font-size: +33pt}
>     // -->
> </STYLE>

This is frequently used - however, oddly enough it is not in the
example given in the HTML spec.

> Now the first and third lines inside the STYLE tag are comments as far
> as CSS browsers are concerned.  Old browsers that don't understand CSS
> will simply think the whole thing is an HTML comment.  Note that a CSS
> capable browser would accept
> 
> <STYLE type="text/css">
>     <!--
>     H1 {font-size: +33pt}
>     //
> </STYLE>
> 
> just fine.

I don't think so.  As I said, the "<!--" is interpreted by the HTML
parser, not the CSS parser - it's just that most browsers have a
"special case" in interpreting HTML comments within CSS.  But most
browsers would still expect you to end your HTML comment.

Micah
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.