They are not classed as ‘within the div container’ yet they should be,
why does the computer not recognize this as valid code yet placing the closing div elements after the first marker still class the 2nd and 3rd DIV elements as within the would be closed DIV container?
but how does the div container separate the first closing tag from the 4th closing tag?
is it the spacing before each tag? this is the only thing I can think of that might be a contributing factor
A div element is composed of both an opening <div> tag and a closing </div> tag. So to place an element after a div would mean to place the element after the closing </div> tag.
right, but with an anchor <a></a> that’s closed, <a> <a> </a> </a> that wouldn’t work because you have to close the first A anchor before adding the second A anchor…?
how does the the div container know that the first closing tag is for the 1st marker and not for the container?
Because some elements can be nested within elements of the same type. You can nest as many divs inside of divs as you like. Same with spans. And sections. And many more.
As far as how the browser determines which closing div tag goes with which opening div tag, it sort of does the same thing you do with your eyes, it keeps track of the number of opening div tags and then looks for the corresponding closing div tags.
Thanks, it’s been straining my brain thinking of all the possible ways that would be possible, the indentures before the nested <`div>'s didn’t make any real difference to the coding aspect
So if the first tag doesn’t close, the system will wait for a spare closing tag to become available and pair them off as a formation? That’s fairly clever.