XHTML Formatting – tag attributes
Quote everything
In order to become a ninja coder you will have to pass the quote test. The rule is simple: quote all attribute values, period.
Here’s a GOOD example:
<a href=“http://yoursite.comâ€>My Site</a>
And here’s a BAD example:
<a href=http://yoursite.com>My Site</a>
In HTML 4 you could get away with not quoting your attribute values but not anymore.
Breaking and spacing
Sometimes when you’re writing xHTML you’ll get a really long line. You’ll probably want to break the line, which is okay, just don’t do it in the middle of an attribute value. It’s likely that your attribute will get messed up if you do. You’ll also want to avoid multiple spaces in attributes as well, just one will do.
<a href= “http://yourdomain.com†title=“A link to
my websiteâ€>My Website</a>
That example just looks ugly. It would be much better if it looked like this:
<a href= “http://yourdomain.comâ€
title=“A link to my websiteâ€>My Website</a>









