how to label matching div elements

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dragon52
    New Member
    • Jun 2009
    • 72

    how to label matching div elements

    Hi,

    How should I label matching div tags in a long piece of code? Useful when trying to find a coding error.

    I can do this

    Code:
    <div id="level1">
      <div id="level2">
      </div>
    </div>
    I don't know how to label the closing </div> tags.

    In wordpress php I do this

    Code:
    <div id="level1">
      <div id="level2">
      </div>
    </div> <?php /*level1*/ ?>
    which looks very cumbersome.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    You mean the end tag? You can't except with comments.

    Comment

    • dragon52
      New Member
      • Jun 2009
      • 72

      #3
      ok, thanks very much!

      Comment

      • Bharat383
        New Member
        • Aug 2011
        • 93

        #4
        <div class="header">
        <div class="logo">
        </div>

        <div class="site_tit le">
        </div>

        <div class="menu">

        </div>
        </div>

        <div class="content" >
        <div class="left_con tent">

        </div>

        <div class="right_co ntent">

        </div>
        </div>
        <div class="footer">

        </div>

        this way you can identify all the main div as well as it's easy to find out the error .....

        Bharat Parmar(Bharat38 3)

        Comment

        Working...