HTML and CSS Reference
In-Depth Information
A typical situation that may arise is one in which your page has a quoted reference in two
dif erent parts of the page. Within a paragraph, you can put in as many quotation marks as
you want and they'll show up on the page. However, only a single set of double quotes can be
assigned as a value to an attribute's value. Consider the following script ( quotes.html in
this chapter's folder at www.wiley.com/go/smashinghtml5 ):
<! DOCTYPE HTML >
< html >
< head >
< title > Be careful with quotation marks </ title >
</ head >
< body >
< p > We read Emily Dickinson's “Wild nights! Wild nights!” < p />
< input type = ”text” size = ”50” value = ”Emily Dickinson's 'Wild nights! Wild nights!'” >
</ body >
</ html >
In the <p> container, the double quotes identify the name of a poem. If the same text is to be
set of as a poem in a value for an attribute, you can use only single quotes for the name of the
poem, as shown in the value assigned to the value attribute. Figure 2-3 shows what the page
looks like in a browser.
35
Figure 2-3: Using quotation marks in HTML5 pages and attributes.
When assigning values to attributes, remember to stick with double quotes for the entire value
and use single quotes for highlighting sections within the value. By and large, life will be easier
if you avoid using single quote marks when assigning values to attributes.
UNDERSTANDING THE ROLE OF THE COMMENT TAG
h e role of the comment tag is to help the developer communicate with other developers, as well
as to serve as a self-reminder of what the page is doing. A well-organized page contains informa-
tion about what the page is doing, what may be added or changed, and any other information that
aids developers in looking at a Web page script and quickly seeing what's taking place.
h e comment tag is really two tags — a beginning tag and an ending tag. Unlike other tags,
the comment tag has no text in it to help identify it. h e following script ( comments.html
in this chapter's folder at www.wiley.com/go/smashinghtml5 ) shows where the
comment tag goes and explains what it's doing.
 
Search WWH ::




Custom Search