... Introducing HTML and XHTML 49
PART II: Creating Web Pages
4 Learning the Basics of HTML 67
5 Organizing Information with Lists 81
6 Adding Links to Your Web Pages 99
7 Formatting Text with HTML and CSS ... Answers
48
Exercises
48
LESSON 3: Introducing HTML and XHTML 49
What HTML Is (And What It Isn’t) 50
HTML Describes the Structure of a Page
50
HTML Does Not Describe Page Layout
51
Why It Works ... Markup Works
53
A Brief History of HTML Tags
53
The Current Standard: XHTML 1.1
54
The Future Standard: HTML5
55
What HTML Files Look Like
55
Text Formatting and HTML
60
Using Cascading Style...
... 573
Determining User Preference
573
Migrating to HTML5
575
Benefits of HTML5
575
What’s Not in HTML5
577
Using HTML5
577
HTML5 and XML
578
XHTML 1.0 and HTML 4.01
579
What Is Accessibility?
579
Common ... Answers 387
Exercises
388
LESSON 13: Advanced CSS: Page Layout in CSS 389
Laying Out the Page 390
The Problems with Layout Tables
390
Writing HTML with Structure
391
Writing a Layout Style ... Optimization
611
Paying for Search Placement
612
xviii
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Download from www.wowebook.com
ptg
Image Backgrounds 238
Specifying...
... documents. Each web page is a file written in
a language called the Hypertext Markup Language (HTML) that includes the text of the
page, a description of its structure, and links to other documents,...
... well far into the future. HTML is as stable now
as it has ever been, and when you learn the core technologies of Hypertext Markup
Language (HTML) , Cascading Style Sheets (CSS) , and JavaScript, you ... interested in supporting and defining the
languages and protocols that make up the Web (HTTP, HTML, XHTML, and so
on). It also provides products (browsers, servers, and so on) that are freely avail-
able ... the
application you use to publish information on the Web, it is likely to be published as
HTML, and understanding how HTML works can help you achieve the results you
desire.
Uniform Resource Locators
As...
... (changing the oil in your car, making a
soufflé, creating landscape portraits in oil, learning HTML) could be described as
online documentation.
n
Shopping catalogs—If your company offers items ... Many people use content management applications to publish their journals
or blogs, but knowing HTML is still helpful for changing the look and feel of your
site and sprucing up your individual ... accessible.)
n
Web page—A single document on a website, usually consisting of an Hypertext
Markup Language (HTML) document and any items that are displayed within that
document, such as inline images.
n
Home...
... a
heading.
What HTML Is (And What It Isn’t)
51
3
Although HTML doesn’t say much about how a page looks when
it’s viewed, Cascading Style Sheets (CSS) enable you to apply
advanced formatting to HTML tags. HTML ... look
good in all kinds of browsers.
The Future Standard: HTML5
The W3C HTML Working Group is busy creating a new standard for HTML: HTML5 .
The goal of HTML5 is to introduce new elements that more accurately ... respectively.
HTML5 does not demand that web pages be valid XML, relaxing some of the rules that
XHTML 1.0 imposed. However, today’s valid HTML or XHTML will still be valid in
HTML5 when it’s...
... does HTML stand for? How about XHTML?
2. What’s the primary function of HTML?
3. Why doesn’t HTML control the layout of a page?
4. What’s the basic structure of an HTML tag?
Quiz Answers
1. HTML ... Language. XHTML stands for Extensible
Hypertext Markup Language.
2. HTML enables you to describe the structure of a document so that it can be styled,
either using HTML tags or using CSS.
3. HTML doesn’t ... started:
<!DOCTYPE html& gt;< ;html& gt;
<head>
<title>My Sample HTML Page</title>
</head>
<body>
<h1>This is an HTML Page</h1>
</body>
< /html& gt;
58
LESSON...
... the text and HTML elements in your web page should be placed within the beginning
and ending HTML tags, like this:
<!DOCTYPE html& gt;< ;html& gt;
your page
< /html& gt;
The < ;html& gt; tag ... Basics of HTML
In HTML, closing some tags is optional. In HTML 4.0 and earlier,
closing tags were forbidden in some cases. HTML standards that
require your markup to be well-formed XML (like XHTML ... 4/XHTML 1.1 and HTML5 , the standards supported by current browsers.
68
LESSON 4: Learning the Basics of HTML
The DOCTYPE Identifier
Although it’s not a page structure tag, the XHTML 1.0 and HTML5 ...
... and preview simple HTML
files. You also learned about the HTML tags shown in Table 4.1.
TABLE 4.1 HTML Tags from Lesson 4
Tag Attribute Use
< ;html& gt; < /html& gt; The entire HTML page
<head> ... Basics of HTML
FIGURE 4.4
HTML comments
displayed within
the source for a
page.
Task: Exercise 4.1: Creating a Real HTML Page
At this point, you know enough to start creating simple HTML pages. ... about
<div> in Lesson 7, “Formatting Text with HTML and CSS. ”
Q Is it possible to put HTML tags inside comments?
A Yes, you can enclose HTML tags within comments, and the browser will not...
... deprecated in
HTML 4.01.
<li> </li> Individual list items in ordered, unordered,
menu, or directory lists. The closing tag
is optional in HTML, but is required in
XHTML 1.0.
type ... naviga-
tion menus
implemented
using lists.
Using a combination of JavaScript and CSS, you can turn a standard HTML list into
a sortable user interface element for a web application. You can ... later lessons. With the introduction of CSS, lists became
one of the fundamental building blocks of web pages.
Summary
In this brief lesson, you got a look at HTML lists. Lists are a core structural...
... optional in HTML but required
in XHTML 1.0.
<dd> </dd> The definition part of an item in a glossary
list. Closing tag is optional in HTML but
required in XHTML 1.0.
TABLE 5.3 CSS Properties ... true HTML
specification, however, using an <li> outside a list tag is illegal, so good HTML
pages shouldn’t do this. Enclosing list items within list tags is also required by the
XHTML ... the name
of the file you created. (Claudius .html is not the same file as claudius .html; it has to
be exactly the same case.) Here I’ve used claudius .html; if you used different files, use
those...
... lead.
TABLE 6.1 Relative Pathnames
Pathname Means
href=”file .html file .html is located in the current directory.
href=”files/file .html file .html is located in the directory called
files, and the ... directory.
href=”files/morefiles/file .html file .html is located in the morefiles
directory, which is located in the files
directory, which is located in the current
directory.
href=” /file .html file .html is located ... Means
href=”/u1/lemay/file .html file .html is located in the
directory
/u1/lemay (typically on
UNIX systems).
href=”/d|/files /html/ file.htm” file.htm is located on the D:
disk in the directory files /html
(on...
... server
explicitly says that the file is HTML or by the file’s extension, browsers will parse and
display that file as an HTML file. If they don’t recognize it as an HTML file, no big deal.
Browsers ... and easily.
What you want is to link the word Byrd in m .html directly to the section for Byrd in
b .html. Here’s the relevant part of b .html you want to link. (I’ve deleted all the Bs
before Byrd ... the HTTP server, usually a file called index .html. If the web page you’re designing
is the top-level file for all a directory’s files, calling it index .html is a good idea. Putting
such a file in...
... 7.3
Text styled using
CSS.
Preformatted Text
Most of the time, text in an HTML file is formatted based on the HTML tags used to
mark up that text. In Lesson 3, “Introducing HTML and XHTML,” I mentioned ... attribute to the <hr> tag in compliance with the XHTML 1.0 specifica-
tion. To comply with HTML5 , you would drop all of the attributes and use CSS
instead. (The noshade attribute can be duplicated ... preformatted
text works.
142
LESSON 7: Formatting Text with HTML and CSS
Horizontal Rules
The <hr> tag, which has no closing tag in HTML and no text associated with it, creates a
horizontal...
... an HTML file, nor have I seen many HTML files that use it. For the most part, you’re
probably safe using plain old quotes (“) in your HTML files rather than the escape code.
Furthermore, HTML ... B, HTML Quick Reference,” includes a table that lists the named entities cur-
rently supported by HTML. See that table for specific characters.
150
LESSON 7: Formatting Text with HTML and CSS
Character ... days, you should control
margins with CSS, as explained in Lesson 8.
NOTE
Download from www.wowebook.com
ptg
146
LESSON 7: Formatting Text with HTML and CSS
Closing Single Tags Properly
Like...