Nested HTML tags

In computers “nested” means “one inside the other” (like “russian dolls”).

Often you have HTML tags inside HTML tags:

<html>
<body>
<p>
This is some text and <b> this is bold text</b>
</p>
<p>
And this is even more text
</p>
</body>
</html>

Note that a tag opened inside another tag must be closed BEFORE the other tag closes. Go over the above and note where EACH tag opens and closes,

The above example is correct. The following is not:

<html>
<body>
<p>
This is some text and <b>
</p>
this is bold text</b>
</html>
</body>

The <b> tag is opened within the <p> tags but is closed is outside (after) them. This is wrong. Ditto the “<html>” opens first and then “<body>” (correct) BUT the “</html>” tag closes before the “</body>” tag has been closed (wrong).

In some cases the computer will try to guess what you actually wanted and correct it “on the fly” without bothering to tell you. BUT in many many cases it cannot guess and your HTML, and therefore your web page, will be mixed up, won’t display correctly, or might not even display at all! It will invariably occur now and again (to err is human and all that). Don’t worry about it, just understand it, and correct it when it occurs.