Download FREE Sample Here

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

URL redirection wikipedia , lookup

Transcript
Full file at http://testbank360.eu/solution-manual-principles-of-html-xhtml-and-dhtml-1st-edition-don-gosselin
Short Quiz 1
1.
Explain the differences between block-level elements and inline elements.
Block-level elements give a Webpage its structure. Most Web browsers render block-level
elements so they appear on their own line. Block-level elements can contain other blocklevel elements or inline elements. The <p> element and heading elements (<h1>, <h2>,
and so on) are examples of common block-level elements. Inline, or text-level, elements
describe the text that appears on a Web page. Unlike block-level elements, inline elements
do not appear on their own lines; they appear within the line of the block-level element that
contains them. Examples of inline elements includethe <b> (bold) and <br> (line break)
elements.
2.
How do you designate the language and text direction of your elements?
Although English is the primary language of the Web, it is certainly not the only language
used. To be a considerate resident of the international world of the Web, you should
designate the language of your elements using the lang attribute. Be aware that the lang
attribute simply states the original language in which an element was written; it is up to the
user agent that renders the element to decide what to do with the information.
You assign to the lang attribute a two-letter code that represents a language. For instance,
the language code for English is en. Therefore, to assign English as the language for a
particular element, you add the attributes lang="en" and xml:lang="en" to the
element’s opening tag.
You must also consider the direction in which a language is read when you define
elements. Although you read most Western languages from left to right, languages such as
Arabic and Hebrew are read from right to left. For this reason, you should always include
the dir attribute along with the lang attribute. You can assign one of two values to the
dir attribute: ltr (for left to right) and rtl (for right to left). For Western languages such
as English, you assign the dir attribute a value of left to right, as follows: dir="ltr".
Full file at http://testbank360.eu/solution-manual-principles-of-html-xhtml-and-dhtml-1st-edition-don-gosselin
3.
Explain how to define the minimized and full form of a Boolean attribute.
When a Boolean attribute is not assigned a value, as in the preceding code, it is referred to
as having a minimized form. However, recall from Chapter 1 that all attribute values must
appear within quotation marks. This syntax also means that an attribute must be assigned
a value. For this reason, minimized Boolean attributes are illegal in HTML. You can still use
Boolean attributes in HTML if you use their full form. You create the full form of a Boolean
attribute by assigning the name of the attribute itself as the attribute’s value. For example,
touse the <input> element’s checked Boolean attribute in HTML, you use the full form of
the attribute as follows:
<input type="checked" checked="checked" />
Remember that to specify a value of false for a Boolean attribute, you simply exclude the
attribute from the element. If you do not want a check box control to be selected by default,
for instance, you simply exclude the checked attribute from the <input> element, as
follows:
<input type="checked" />
Short Quiz 2
1.
Explain how you should use heading elements in your documents.
You should choose a heading element based on how the sections of your document fit
together rather than how the headings appear in a Web browser—different user agents
render the output of heading elements differently. Although many Web page authors use
heading elements as a formatting tool, their real purpose is to provide away of outlining the
content of your document, much as you would create an outline or a table of contents. In
those formats you wouldn ot use a higher- numbered heading unless it was nested under a
lower numbered heading, but this is not a requirement for writing well-formed HTML
documents.
Full file at http://testbank360.eu/solution-manual-principles-of-html-xhtml-and-dhtml-1st-edition-don-gosselin
There are several rules of thumb for using headings. Generally, most Web pages should
include only a single <h1> element as the main heading for a page. You can think of the
<h1> element as being equivalent to the title of a document, and a document should
contain only one title. Second-level headings should use the <h2> element, and additional
higher-numbered headings should be nested beneath lower-numbered headings.
2.
Why should you use <section>, <header>, and <footer> elements in your Web pages?
Sections created with the <section> element usually define specific types of organized
content such as chapters or other types of logical groupings. A header section defines an
introduction to a document or section. A footer section usually is placed immediately after
a section element and contains information about that section, such as when it was created
or last updated, the author, and copyright information.
3.
What type of content should you normally place inside an <article> element?
The <article> element defines a link to external content such as a news article or Web
log (blog). Although there are no requirements for what you place in an <article>
element, it should normally include a brief description of the article, a link to the external
URL, and the date of publication.
4.
How do you define a navigation section that contains links to other parts of the current page
or to other pages?
You use the <nav> element to define a navigation section that contains links to other parts
of the current page or to other pages. Any major navigation blocks should be placed inside
the <nav> element.
5.
What is white space and why is it important to Web page design?
White space is an important design element that refers to the empty areas on a page. It
makes a page easier to read and enhances visual appeal. Beginning Web page authors
are often tempted to pack each page with as much information as possible, but
Full file at http://testbank360.eu/solution-manual-principles-of-html-xhtml-and-dhtml-1st-edition-don-gosselin
experienced authors know that white space is critical to the success both of Web pages
and traditional printed pages.
Short Quiz 3
1.
Explain the difference between absolute and relative URLs.
An absolute URL refers to the full Web address of a Webpage or to a specifi c drive and
directory. A relative URL specifi es the location of a fi le relative to the location ofthe
currently loaded Web page.
2.
How do you link within the same Web page?
Bookmarks are internallinks within the current document and can be an eff ective tool
forhelping users navigate through a long Web page. You create bookmark links by using
the id attribute. Recall thatthe standard id attribute uniquely identifi es an individual
elementin a document. Any element that includes an id attribute can bethe target of a link.
For instance, you may have a long Web pagewith an <h2> element near the bottom that
reads “Summary of Qualifi cations”.To create a bookmark to any other element, including
headingelements, you nest an <a> element inside another element. If an <a>element does
not include an href attribute (it shouldn’t when you arecreating a bookmark), its contents
are treated as normal text and aresubject to the rules of the parent element. Th erefore, if
the contentof an <a> element does not include an href attribute and is nestedinside a
heading element, it will be formatted in a browser with thestyle of the parent heading
element.
3.
What steps are involved in publishing a Web page?
Before you publish your Web pages, you need to decide where theWeb site will be hosted,
create and register a domain name for thesite, and post the fi les via FTP to the Web
server.
4.
What is metadata and how do you add it to your Web pages?
Full file at http://testbank360.eu/solution-manual-principles-of-html-xhtml-and-dhtml-1st-edition-don-gosselin
Th e term metadata refers to data that describes the defi nition andstructure of information.
Metadata in HTML is enclosed withinthe <head> element. In a Web page, you use the
<meta> element toinform search engines and Web servers about the information in
yourWeb page. You must place the <meta> element within the <head>element. You can
use three primary attributes with the <meta> element:name, content, and http-equiv. You
use the content attributeto provide information that is required by both the name andhttpequiv attributes. Th erefore, the only required attribute in the<meta> element is the
content attribute.
5.
Explain why you would use a robots <meta> element instead of the robots.txt file to inform
search-engine spiders of the directories and files you do not want indexed.
An alternate method for preventing spidersfrom indexing certain Web pages is to create a
robots <meta> elementfor each Web page. You create this element by assigning a value
ofrobots to the <meta> element’s name attribute. You then assign oneor more of the
following values to the content attribute: index,noindex, nofollow, or none. Th e index
value instructs a spider to indexthe page, the noindex value instructs a spider not to index
the page,and the nofollow value instructs a spider not to follow any links onthe page.