Div coding assistance

  • skyvia
  • Novice
  • Novice
  • No Avatar
  • Joined: Jan 24, 2011
  • Posts: 32
  • Status: Offline

Post April 21st, 2011, 3:17 am

I am trying to get my head around DIV code tags and want to ask a simple ish question.

If I open a div statement and then open another div statement, how does the page know which closing tag is for which statement, or does it not matter?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 21st, 2011, 3:17 am

  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post April 21st, 2011, 10:10 am

The parser takes the closest closing tag to the open tag to make a complete statement... for example... the closing tag and open tags are color coded below... the ones that are the same color go together.

<div id="tag1">
<div id="tag2">
<div id="tag3">

</div>
</div>
</div>

I don't think I explained that well with words, but that should help you understand... It's like a DIV statement inside a DIV statement.


When you write a DIV statement it looks like:
HTML Code: [ Select ]
<div>
 
</div>
  1. <div>
  2.  
  3. </div>
What you put inside that statement, goes inside it... even if it's another DIV statement.
HTML Code: [ Select ]
<div>
<div>
 
</div>
</div>
  1. <div>
  2. <div>
  3.  
  4. </div>
  5. </div>
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 127 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.