Web Design

(Nancy Kaufman) #1

27


CHAPTER

Getting Started with HTML 2


Am I required to add the declaration to the page?
Browsers will display your page without it, but some
browsers are more likely to make mistakes in the
rendering if you do not have a proper document type,
so adding the declaration is strongly recommended.
Most dedicated HTML editors add the declaration for
you, so you may not have to actually type it.

What is the difference between the types?
HTML and XHTML Transitional are the least
restrictive types and the most appropriate for most
documents. Strict forces you to exactly follow the
syntax of the languages and Web standards, so it is
more difficult to code. Frameset provides additional
tags for use in frames, but few Web sites use frames
anymore.

● For HTML 4.01 Transitional,
type <!DOCTYPE HTML
PUBLIC “-//W3C//
DTD HTML 4.01
Transitional//EN”
“http://www.w3.org/
TR/html4/loose.
dtd”>.

The document type declaration
is added to the page.


● For XHTML Strict, type
<!DOCTYPE html
PUBLIC “-//W3C//DTD
XHTML 1.0 Strict//
EN” “http://www.
w3.org/TR/xhtml1/
DTD/xhtml1-strict.
dtd”>.

TIPS

Free download pdf