
What Beautiful HTML Code Looks Like - malte
http://css-tricks.com/what-beautiful-html-code-looks-like/
======
pbhjpbhj
Interested that he's using explicit closed tags on eg <img /> which in html is
not required. Perhaps "/" are pretty?

 _This is the same as in HTML4. However, due to the widespread attempts to use
XHTML1, there are a significant number of pages using the trailing slash.
Because of this, the trailing slash syntax has been permitted on void elements
in HTML in order to ease migration from XHTML1 to HTML5._ (
[http://wiki.whatwg.org/wiki/FAQ#Should_I_close_empty_element...](http://wiki.whatwg.org/wiki/FAQ#Should_I_close_empty_elements_with_.2F.3E_or_.3E.3F)
)

~~~
jamesbritt
Perhaps having well-formed XML is handy for, say, checking the markup.

~~~
pbhjpbhj
I anticipated that remark but didn't want to over comment, from that same link
- to save me typing:

 _If I’m careful with the syntax I use in my HTML document, can I process it
with an XML parser?

No, HTML and XML have many significant differences, particularly parsing
requirements, and you cannot process one using tools designed for the other.
However, since HTML5 is defined in terms of the DOM, in most cases there are
both HTML and XHTML serializations available that can represent the same
document. There are, however, a few differences explained later that make it
impossible to represent some HTML documents accurately as XHTML and vice
versa._

~~~
jamesbritt
Right; it's hard to be both HTML and XML, so you need to use the XHTML
serialization of HTML5 if you want use XML (which is what the example document
appears to be).

~~~
pbhjpbhj
I'd heard of the idea of using XML forms (explicit self closing tags) in HTML5
to allow it to be parsed as XML, but only at the start of the week began
writing my first HTML5 DTD pages. I'd put my weight behind XHTML2 winning but
that sadly seems to look ever less likely. I'd assumed that if I kept my <img
/> and <meta />, etc., void tags as is things would work fine .. it looks like
they should.

But, the whatwg who have many more people and spend many more hours on this
tell me "it's not that simple, it won't work" I tend to have to take that on
face value - I can't afford to write 40 pages using XHTML style void tags and
then have an FF upgrade baulk because some nuance of HTML5 parsing spews at my
tags.

FWIW.

~~~
jamesbritt
As far as I can tell you have a choice of using HTML or XHTML syntax. The "it
won't work" thing refers to trying to create what is ostensibly an HTML
document but using XML syntax.

The kicker with going the XHTML path, though, is the expectation that the
document will be served with a particular content-type header meant for
XHTML/XML documents. This is no different than what's (supposedly) required
for XHTML documents right now, yet very few people use the correct header
(even people who chide others for not using XHTML).

------
KevBurnsJr
I wouldn't call <ul class="col"> very semantic. At all.

<ul class="people"> maybe.

