Tag query

R

rblah

Do you know if it's valid to have spaces between the start of a tag and
the tag's text? For example, would < a
href="http://www.kuro5hin.org" > be valid?

If at all possible, a reference to W3C would be great! :)
 
J

Jukka K. Korpela

rblah said:
Do you know if it's valid to have spaces between the start of a tag
and the tag's text? For example, would < a
href="http://www.kuro5hin.org" > be valid?

It is valid (in HTML), but there is no tag in it, just text data.

The "<" is recognized as starting a tag only when immediately followed
by a name start character (a letter) or by "/". Otherwise it is taken as
a data.
If at all possible, a reference to W3C would be great! :)

Unfortunately the material at W3C doesn't really describe the details of
HTML syntax at the lexical level very well. It generally refers to the
SGML standard (and, in XHTML specs, the XML specification), and makes
quite some handwaving in referring to some SGML features as not commonly
implemented. But in _this_ issue, browsers behave according to the SGML
standard, because it corresponds to how a naive programmer would
implement tag recognition.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top