What does HTML5 specify?
The structure and content of documents that are displayed in web browsers.
Name the four "more sophisticated" HTML5 techniques listed in the introduction.
Tables, forms, internal linking, and meta elements.
Which filename extensions are used for HTML5 documents?
.html or .htm
Why is the DOCTYPE required in HTML5 documents?
So that browsers render the page in standards mode. (Some browsers use quirks mode for backward compatibility with pages that are not up-to-date.)
How do HTML5 comments start and end? Does the browser show them?
They start with <!-- and end with -->. The browser ignores comments when rendering.
head section vs. body section
head: information about the document (character set, title; can also hold CSS3 style sheets and scripts). body: the page's content, which the browser displays.
What is UTF-8?
The most popular character-encoding scheme for the web (the character set given in the head section).
Start tag, end tag and void element
Start tag: element name in angle brackets, e.g. <html>. End tag: name preceded by a forward slash, e.g. </html>. Void elements do not have end tags.
How is an attribute written?
In a start tag, as a name and a value separated by an equals sign (=).
Where does the title appear, and how do search engines use it?
In the browser's title bar/tab and as the text identifying a bookmark. Search engines use the title for indexing purposes and when displaying results.
What does a validation service such as validator.w3.org do?
It ensures that an HTML5 document is syntactically correct (syntactically correct documents are guaranteed to render properly).
How many heading elements are there, and which is the most significant?
Six (h1 through h6). h1 is the most significant and is rendered in the largest font; each successive heading is progressively smaller.
How do browsers display text hyperlinks by default?
Underlined and colored blue.
What does the strong element indicate?
That the content has high importance (browsers typically render it in bold).
What can the href attribute of an anchor point to?
A web page or a location within a web page, a file, or an e-mail address.
What happens when a URL names no specific document, and when the document cannot be found?
No document: the server returns a default web page, often index.html. Not found: the server returns a 404 error and the browser shows an error page.
How do you link to an e-mail address?
With an anchor whose href is a mailto: URL, e.g. <a href = "mailto:deitel@deitel.com">…</a>. Clicking it typically opens the default e-mail program.
What are the most popular image formats used by web developers?
PNG (Portable Network Graphics) and JPEG (Joint Photographic Experts Group).
img: what do src and alt do, and is alt optional?
src specifies the image's location. alt (required on every img) contains text displayed if the client cannot render the image; speech synthesizers read it, so it should describe the image.
Are width and height required on img? What unit?
No, they are optional; if omitted the browser uses the image's actual width and height. Images are measured in pixels.
What is a void element? Give an example and how it can be terminated.
An element that contains only attributes and does not mark up text, e.g. img (or br). It can be terminated with a forward slash inside the closing angle bracket: <img … />.
What form do character entity references take, and what can the code be?
&code; — the code can be a word abbreviation or a number (decimal or hexadecimal).
Entity references for ©, &, < and non-breaking space
© = © & = & < = < non-breaking space =
Which elements give subscript, superscript and strike-through text in Fig. 2.9?
sub (subscript, e.g. x<sub>1</sub>), sup (superscript, e.g. 10<sup>2</sup>), del (strike-through).
ul vs. ol
ul (unordered list): each item begins with a bullet symbol (typically a disc). ol (ordered list): each item begins with a number. Each entry in both is an li element.
Why nest lists?
To represent hierarchical relationships, as in a multi-level outline.
What do the table's caption element and summary attribute do?
caption: specifies the table's title. summary: summarizes the table's contents; used by speech devices to make the table accessible to users with visual impairments.
Three sections of a table and what each holds
thead: table titles, column headers. tbody: primary table data. tfoot: calculation results, footnotes — written above the body in the code but displayed at the bottom.
tr, th and td
tr defines a table row; th defines a header cell; td contains table data.
What do rowspan and colspan do, and where can they go?
They merge cells: their values give the number of rows or columns the cell occupies. They can be placed inside any data cell or table header cell.
Why should br and hr be avoided?
They are considered legacy formatting elements; in general, formatting should be specified using CSS.
method="post" vs. method="get"
post appends the form data to the browser request (which contains the protocol and the requested resource's URL). get appends the form data directly to the end of the URL, where it is visible in the browser's Address field.
What does the form's action attribute specify?
The script to which the form data will be sent (the form handler).
What are hidden inputs?
Nonvisual form components that store any data you specify, such as e-mail addresses and HTML5 document file names that act as links.
In a text input, what do label, size and maxlength do?
label: tells users the input element's purpose. size: number of characters visible in the field. maxlength (optional): limits the number of characters input.
submit vs. reset
submit: sends the form's data to the location in the action attribute (value sets the button text). reset: returns all form elements to their default values.
textarea: rows and cols
textarea inserts a multiline text area; rows sets the number of rows and cols the number of columns (characters per line).
What does the password input send to the server?
The actual value typed — not the asterisks that mask the input on screen.
checkbox vs. radio
Checkboxes can be used individually or in groups (same name), and several can be checked. Radio buttons: only one in a group can be selected; all have the same name but different values.
How is a drop-down list made?
With select (its name attribute identifies the list); option elements add the items.
How do you link to a section of the same page?
Give the target element an id and use the syntax #id as the link's href.
keywords vs. description meta elements
keywords: content lists words describing the page, compared with words in search requests. description: content gives a three- to four-line description of the site in sentence form, used to catalog it and sometimes shown in search results.