beautypg.com

Adobe Dreamweaver CS3 User Manual

Page 310

background image

DREAMWEAVER CS3

User Guide

303

XHTML requirement

Actions Dreamweaver performs

There must be a DOCTYPE declaration in the
document prior to the root element, and the
declaration must reference one of the three
Document Type Definition (DTD) files for XHTML
(strict, transitional, or frameset).

Adds an XHTML DOCTYPE to an XHTML document:

XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xht
ml1-transitional.dtd">

Or, if the XHTML document has a frameset:

XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xht
ml1-frameset.dtd">

The root element of the document must be

html

, and the

html

element must designate

the XHTML namespace.

Adds the

namespace

attribute to the

html

element,

as follows:

xmlns="http://www.w3.org/1999/xhtml"
>

A standard document must have the

head

,

title

, and

body

structural elements. A

frameset document must have the

head

,

title

, and

frameset

structural elements.

In a standard document, includes the

head

,

title

,

and

body

elements. In a frameset document, includes

the

head

,

title

, and

frameset

elements.

All elements in the document must nest prop-
erly:

This is a bad
example.

This is a
good example.

Generates correctly nested code and, when cleaning up
XHTML, corrects nesting in code that was not generated
by Dreamweaver.

All element and attribute names must be lower-
case.

Forces HTML element and attribute names to be lower-
case in the XHTML code that it generates and when
cleaning up XHTML, regardless of your tag and attribute
case preferences.

Every element must have a closing tag, unless it
is declared in the DTD as EMPTY.

Inserts closing tags in the code that it generates, and
when cleaning up XHTML.

Empty elements must have a closing tag, or the
opening tag must end with

/>

. For example,


is not valid; the correct form is



or


. Following are the

empty elements:

area

,

base

,

basefont

,

br

,

col

,

frame

,

hr

,

img

,

input

,

isindex

,

link

,

meta

, and

param

.

And for backwards-compatibility with browsers
that are not XML-enabled, there must be a space
before the

/>

(for example,


, not


).

Inserts empty elements with a space before the closing
slash in empty tags in the code that it generates, and
when cleaning up XHTML.

Attributes can’t be minimized; for example,

is not valid; the correct form is

.

This affects the following attributes:

checked

,

compact

,

declare

,

defer

,

disabled

,

ismap

,

multiple

,

noresize

,

noshade

,

nowrap

,

readonly

, and

selected

.

Inserts full attribute-value pairs in the code that it gener-
ates, and when cleaning up XHTML.

Note: If an HTML browser does not support HTML 4, it
might fail to interpret these Boolean attributes when
they appear in their full form.

All attribute values must be surrounded by
quotation marks.

Places quotation marks around attribute values in the
code that it generates, and when cleaning up XHTML.

September 4, 2007