Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Creating a simple XHTML page
- PATRICIA THOMPSON
December 29, 2005, 5:19 pm
rate this thread
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml " xml:lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="keywords" content="CIW, XHTML 1.0, Habitat for Humanity"/>
<meta name="Description" content="Simple XHTML page for Habitat site"/>
<title>Habitat for Humanity International Summer Youth Blitz Program</title>
Join a Summer Build for Teen-agers.
The Summer Youth Blitz is a unique service experience for a diverse group of
youth, ages 16 to 18, from high schools and youth organizations around the
United States. This page will validate as XHTML 1.O Transitional.
can anybody tell me what is wrong with this code.
- Jukka K. Korpela
December 29, 2005, 7:56 pm
Re: Creating a simple XHTML page
PATRICIA THOMPSON wrote:
I suppose your request "can anybody tell me what is wrong with this
code" meant to ask what is _technically_ or, more exactly,
_syntactically_ wrong with it.
The line quoted above has the first syntax error. It has two consecutive
quotation marks at the end of the first attribute; remove on of them.
That's syntactically valid but not recommended. The recommendation is to
leave a space before the "/". Moreover, the tag is mostly useless or worse.
Ditto. Why would you emphasize XHTML here? It's just the technical
format of the document. Besides, it's a _wrong_ format on the Web.
Didn't anyone tell you that Internet Explorer does not support XHTML and
has no expressed intentions of doing so in the foreseeable future.
That's not allowed in XHTML 1.0 Strict, which your document in fact
purports to use (in the DOCTYPE declaration). It's also harmful, since
you would set background color _only_. Always set background color,
background image, text color, and the three different link colors if you
set one of them (and do that in CSS, not in HTML). If you don't know how
to do that, don't set any of them before you know the techniques.
The body starts with text, which is not allowed in XHTML 1.0 Strict:
all content must be wrapped inside block level containers like
<h1>...</h1>, <p>...</p>, or <div>...</div>.
> This page will validate as XHTML 1.O Transitional.
That would be a worse than pointless statement on a page even if it were
true. Cf. to the damage caused by "Valid HTML!" icons, as explained at
(Besides, it's 1.0 with digit zero, not 1.O with capital letter o.)
Suggestion: Use HTML 4.01 Strict.
P.S. In future, please post a URL, not a copy of the HTML source.