Posts Tagged ‘HTML5’

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

Posted in (X)HTML Tips

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>