HTML coding convention

Is there any tutorial or document which explains best practice about how to style your html code for a better readability, like Manual :: Coding Standards is for php?

Indenting and Line Length, how to short the line etc.

Not an official one although you have to take notice of whitespace for certain aspects and data types in (x)html. Typically you indent the block-level start tags to match the end tags when nesting.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>
      Snoring Snakes
    </title>
  </head>
  <body>
    <div>
      <p>
        Hello I am a Sentence.
      </p>
      <p>
        I am a <span title="Annoying funny vermin">Woodchuck</span>!
      </p>
    </div>
  </body>
</html>

Obviously that is just a crude example but there’ll be loads of sites that have tips regarding code formatting.

-Little Bump-

This is a bit of a late reply, but I think you’ll find some interesting and helpful comments and examples in my old Markup Formatting and [URL=“http://www.sitepoint.com/forums/html-xhtml-52/best-web-page-structure-convention-626535.html”]Best Web Page Structure Convention? threads. I’ve searched far and wide and haven’t found any particular tutorials, documents, or manuals either but the general census is that you do make indents that match up with appropriate nesting, how ever many indents is your choice, but not so many that horizontal scrolling starts to happen.

I hope them two threads help you, they certainly helped me. :slight_smile:

Andrew Cooper