RE: Good or just Valid HTML?

> I have run into a problem I need to get clear in my mind.
>
> Tidy allows (and creates) the following URL formats.
> The W3C validator passes the following URL formats.
>
> <a href=
> "http://www.xxxxxxx.com/yyyyyy/zzzzzz.htm">
>
> <a
> href="http://www.xxxxxxxl.com/yyyyyy/zzzzzz.htm">
>
> Are the above valid but bad HTML?

After the < and the element name, you can have any whitespace before and after
the attribute name, before and after the = sign, or between the attribute value
and the closing > of the start tag.

Bad?  How so?  The following is perfectly valid:


	<a
            href         =

	"foo"
                  >


If by bad, you mean hard-to-read, well yes -- in that example.  But in the case
of long URLs, it sometimes makes sense to linebreak before or after attributes,
since you don't want to break the URL itself.


/Jelks

Received on Tuesday, 28 March 2000 01:45:28 UTC