Why div does not have closing tags

Hello, I am just trying to understand why certain lines have < div> and then </ div> to close and then there are lines that just have > to close.

Here is an example:
< div class=“characters” >

< div id=“head” >< /div>

Can someone tell me what the difference is? Thank you!

Where are you seeing this?

I am seeing it in the Picasso painting.

< div id="back-wall">< /div>
< div class="characters" >
          < div id="offwhite-character" >
            < div id="white-hat">< /div>

Im just trying to understand why not all have div closing tags. Im way past that step. Im just wondering why it shows up like that.

1 Like

Which step in the project?

its step 12 and 13. I have answers corrent. I just want to know why it shows up like that. What is the reason why certian lines do not have a >< /div> in general

Step 12 starts off with:

  <body>
    <div id="back-wall"></div> /* opened & closed on same line */
        <div class="characters"> /* opened for class="characters" */

          </div>  /* closed for class="characters"  */
      </body>

Each opening div tag has corresponding closing div tag.

Step 13 starts off with:

  <body>
    <div id="back-wall"></div> /* opened & closed on same line */
        <div class="characters"> /* opened for class="characters" */
          <div id="offwhite-character"> /* opened for id="offwhite-character */

          </div> /* closed for id="offwhite-character" */
        </div>  /* closed for class="characters"  */
  </body>

Same thing here. Each opening div tag has corresponding closing div tag.

The only things that bothers me is the starting with the div with class="characters", it should not be indented over 4 spaces like it is currently shown.

I have created a GitHub issue to try and get it fixed. Feel free to comment on the issue if you are interested in helping to fix this.