Prev | Current Page 111 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"


HTML comments begin with , and can run over multiple lines, as
follows:


In XHTML, double hyphens should not occur within the comment itself. Therefore, the following
is not valid XHTML:


The multiple-hyphen comment is commonly used by designers who favor hand-coding to
separate large chunks of code within a document. When working in XHTML, you can
replace the hyphens with a different character:


CSS comments were covered in the ???Creating boilerplates??? section of Chapter 1, but we??™ll
briefly look through them again; they??™re opened with /* and closed with */ and, like HTML
comments, can run over multiple lines, as shown here:
/* This is a comment in CSS */
/*
Multiple-line
CSS
comment
*/
Multiple-line comments in JavaScript are the same as in CSS, but single-line comments are
placed after double forward slashes:
// This is a single-line JavaScript comment.
Don??™t use comments incorrectly. CSS comments in an HTML document won??™t be problematic
from a rendering standpoint??”but they will be displayed. HTML comments in CSS can
actually cause a CSS file to fail entirely.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
58
Web page essentials checklist
Congratulations??”you made it to the end of this chapter! I??™m aware that some of this one
was about as much fun as trying to work out complex quadratic equations in your head,
but as mentioned at the start, you need to know this stuff.


Pages:
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123