By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,727 Members | 1,391 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,727 IT Pros & Developers. It's quick & easy.

how to label matching div elements

P: 72
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

Expand|Select|Wrap|Line Numbers
  1. <div id="level1">
  2.   <div id="level2">
  3.   </div>
  4. </div>
  5.  
I don't know how to label the closing </div> tags.

In wordpress php I do this

Expand|Select|Wrap|Line Numbers
  1. <div id="level1">
  2.   <div id="level2">
  3.   </div>
  4. </div> <?php /*level1*/ ?>
  5.  
which looks very cumbersome.
Feb 7 '12 #1
Share this Question
Share on Google+
3 Replies


drhowarddrfine
Expert 5K+
P: 7,435
You mean the end tag? You can't except with comments.
Feb 7 '12 #2

P: 72
ok, thanks very much!
Feb 7 '12 #3

P: 93
<div class="header">
<div class="logo">
</div>

<div class="site_title">
</div>

<div class="menu">

</div>
</div>

<div class="content">
<div class="left_content">

</div>

<div class="right_content">

</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(Bharat383)
Apr 16 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.