10
XHTML is aimed to replace HTML XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version of HTML XHTML is HTML defined as an XML application

XHTML is aimed to replace HTML XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version of HTML XHTML is HTML defined as

Embed Size (px)

Citation preview

Page 1: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

XHTML is aimed to replace HTML XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version of

HTML XHTML is HTML defined as an XML

application

Page 2: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

The rules for writing XHTML documents are:

All tag and attribute names must be in lowercase

"Empty" tags must be written with an extra slash at the end

You can never omit an end tag

Attributes must always have a value

Attributes values must always be quoted

Page 3: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

LEGACY HTML

<A HREF=“index.html"> ...</A>

XHTML

<a href=“index.html">...

</a>

Page 4: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

LEGACY HTML

<img src="foo.html">

XHTML

<img src="foo.gif” />

Page 5: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

LEGACY HTML

<p> ..... paragraph text <p> ..... more paragraph text

XHTML

<p> ..... paragraph text </p><p> ..... more paragraph text </p>

Page 6: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

LEGACY HTML

<hr size="2” noshade>

XHTML

<hr size="2" noshade="noshade" />

Page 7: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

LEGACY HTML

<hr size=2>

XHTML

<hr size="2" />

Page 8: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

XHTML elements must be properly nested, be closed, be in lowercase, and be nested within the <html> root element

Attribute names must be in lower case, values must be quoted

The id attribute replaces the name attribute

The XHTML DTD defines mandatory elements

All XHTML documents must have a DOCTYPE declaration.

The html, head , title, and body elements must be present

Page 9: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>simple document</title> </head><body> <p>a simple paragraph</p></body></html>

Page 10: XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as

An XHTML DTD describes in precise, computer-readable language, the allowed syntax and grammar of XHTML markupStrict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Use this when you want clean markup, free of presentational clutter. Use this together with CSS.

Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand CSS.

Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Use this when you want to use HTML Frames to partition the browser window into two or more frames.