|
Posted by cwdjrxyz on 07/20/07 02:29
On Jul 19, 12:39 pm, 0dev <ch1.w...@yahoo.com> wrote:
> On Jul 16, 5:01 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
>
> > These days, such document errors typically reflect the common cluelessness
> > of mixing HTML and XHTML. Using e.g. <meta ... /> in an HTML 4.01 document
> > means, by specifications, that the "/" closes the meta tag and ">" is
> > character data, which thus implicitly closes the head element and opens the
> > body element. This goes, of course, far above the heads of authors who blame
> > a validator for their own errors.
>
> No need to be rude. Thanks for the tip though.
>
> The closed meta tag was copied and pasted from Google's Webmaster
> Control Panel. I assumed that closing all elements in HTML was
> optional (e.g. closing tag of </p> is optional).
In html(notxhtml) closing of several tags such as <p></p> is optional.
However in xml based languages, everything must be closed. This is one
of the most important things to do, especially for many small devices,
some of which do not even understand html and which often will not
work if everything is not closed.. In the case of xhtml, many tags are
carried over from html as well as some pure xml ones are used. When a
tag has an optional closing tag such as <p> then the optional(in html)
closing tag such as </p> must be used. When a tag such as <img blah>
has no closing tag in html, the tag must be self closed in xhtml such
as <img blah />. Actually the space between blah and / is there for
practical reasons, since some older browsers, and a few not so old
ones, will not understand the tag properly without the space. In many
pure xml languages, such as SMIL, no space is required. Most PC
browsers do not understand W3C SMIL 2 properly, although reader or
viewer programs for it, including recent Real players do. IE6 does
support a very watered down version of SMIL that works on IE browsers
only. The W3C validator often will fault you if you use a self closing
tag in an html program. This is correct, because it is not part of
html. However, many, if not most, recent browsers in wide use will
still work properly if you slip a self closed xhtml tag into a html
4.01 document. I am in the habit of closing <p> etc even when optional
when writing an xhtml 4.01 page. This helps prevent forgetting to do
this when writing xml or xhtml. Also tags in xhtml must be in lower
case, while case does not matter in html(although case is important in
javascript.) Hence I write tags in lower case when writing xtml 4.01
to help prevent making mistakes in xhtml or other languages where case
is important. Errors such as wrong case or wrong closing tag can be
difficult to catch. Many people tend to read what they thought they
wrote rather than what they actually wrote. One big advantage of the
W3C validator is that it often will catch such errors.
Navigation:
[Reply to this message]
|