Looks familiar.
You may have notice that HTML tags can be nested. For example, in the following the pre-formatted text is nested inside the blockquote:
<blockquote> <pre> Indented, preformatted, text </pre> </blockquote>
correct | wrong |
---|---|
( [ ] ) |
( [ ) ] |
<blockquote> <pre> </pre> </blockquote> |
<blockquote> <pre> </blockquote> </pre> |
This is correct syntax, and does what you expect. The <blockquote> "turns on" the blockquote, then the <pre> "turns on" pre-formatting, so both apply.
To follow correct syntax, you should "turn off" features in the backward order of how they were turned on. So if pre-formatting was last to be turn on, it should be first to be turned off (as is done in the above). Another way to think of this is that tags nest like parentheses and brackets in math (or programs).
Most browsers do not enforce this rule, but the official latest version of HTML (XHTML) requires this.
Is the following correctly nested?
<blockquote> <pre> </pre> <blockquote> </blockquote> <pre> </pre> </blockquote>
(It is OK to have a blockquote inside of a blockquote).