Forum Moderators: open
</div>. I've seen people put a comment after the closing tag so they know which div it is, like this:
<div id="header">
</div><!-- header -->
I think I have a better solution. One that's so simple, I don't know why I didn't think of it before! Just duplicate the id of the div in the closing tag:
</div id="header">
Also, does it invalidate the XML structure of an XHTML document?
If there are no problems with my approach, I consider it a valuable solution to this problem.
Why not just use indenting instead? Like this..
<body>
<div id="header">
<h2>Widgets</h2>
<div>
blah blah blah
</div>
</div>
<p>
blah blah blah
</p>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
</body>
it will use less bytes than your suggestion (use TABs for the indents), it is easier to read and definitely won't make your code invalid.