Reply to Re: </A> not needed?

Your name:

Reply:


Posted by Toby Inkster on 06/25/06 09:59

Jonathan N. Little wrote:

> Bug. Not the first time.

It's not a bug. For HTML the W3C validator is virtually bug-free. It has
one or two limitations when dealing with XML, but that's about it.

As David Dorwood pointed out,

<a href=http://example.org/>Example</a>

is actually *invalid*, but

<a href=http://example.org/>Example

is (perhaps surprisingly) *valid*! But neither means what you think it
might mean. The reason for this is SGML's "SHORTTAG" feature which allows
for a few odd-looking shorthands for common contructs. For example:

<b/Text/

is shorthand for:

<b>Text</b>

Similarly:

<a href=http://example.org/>Example</a>

is shorthand for:

<a href="http:"></a>example.org/&gt;Example</a>

And note now that you have two closing "</a>" tags, which is why it's
invalid.

The rule to take away from this is to quote attribute values. That is:

<a href="http://example.org/">Example</a>

which will mean exactly what you expect it to mean. There are occasions
when it's OK in HTML to leave out the quote marks, but it's never harmful
to include them; so if you're unsure, always include the quote marks.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация