Emulating HTML5 using comment tags to make your HTML easier to edit

29 Oct, 2008

No Comments

This is something I’ve been doing in all of the pages I’ve been coding for the last year or so. I’ve noticed other designers doing similar things. This is a simple little trick that makes hand editing code a lot easier.

Associating end tags with start tags using comments

Quite simply all I do is this:

  1. <div id="footer">
  2.  
  3. <p>footer content here</p>
  4.  
  5. </div>
  6. <!– /#footer –>

If I need to edit the code quickly I can easily establish the start and end of any particular element. This is similar to the HTML5 format, which is not yet being used by browsers, because HTML5 is going to be formatted something like this:

  1. <footer>
  2.  
  3. <p>footer content here</p>
  4.  
  5. </footer>

View more entries from (X)HTML Tips

This entry was tagged: , ,

Leave a Comment