Académique Documents
Professionnel Documents
Culture Documents
Chapter 2
Learning Outcomes
In this chapter, you will learn about:
XHTML syntax, tags, and document type definitions The anatomy of a web page Formatting the body of a web page Formatting the text on a web page Special Characters Connecting Web pages using hyperlinks
What is HTML?
HTML: The set of markup symbols or codes placed in a file intended for display on a Web browser page. The World Wide Web Consortium (http://w3c.org) sets the standards for HTML and its related languages.
What is XHTML?
The newest version of HTML eXtensible HyperText Markup Language. XHTML uses:
the elements and attributes of HTML the syntax of XML (eXtensible Markup Language).
XML Syntax
An XML document must be well-formed.
Use lowercase Use opening and closing tags
</body>
Body Section
Contains text and elements that display in the Web page document
<body>
<h1>content</h1>
Closing Tag The closing tag always needs a slash before the tag name.
XHTML Attributes
Attributes always go inside the opening tag.
XHTML Elements
Top-level elements: html, head, and body Head elements: title, meta and script Body elements:
Block-Level elements : take the tagged text and separate it from the rest of the document flow Inline elements : they can be nested almost anywhere within a block-level
<dt> tag
Contains a defined term Configures a line break above and below the text
<dd> tag
Contains a data definition or description Indents the text
<li>
Contains an item in the list
Checkpoint
Describe the features of a heading tag and how it configures the text.
23
Absolute link
Link to other Web sites
<a href="http://yahoo.com">Yahoo</a>
Relative link
Link to pages on your own site <a href="index.htm">Home</a>
24
26
Checkpoint
Describe when to use an absolute link. Is the http protocol used in the href value? Describe when to use a relative link. Is the http protocol used in the href value?
28
Summary
This chapter provided an introduction to XHTML. It began with an introduction to the HTML, discussed the transition to XHTML, continued with the anatomy of a web page, introduced inline and block-level formatting, and demonstrated the XHTML techniques used to create hyperlinks. You will use these skills over and over again as you create Web pages.