In HTML some elements can be improperly nested within each other like this:
在HTML中一些元素可以不使用正确的相互嵌套像这样:
<b><i>This text is bold and italic</b></i>
In XHTML all elements must be properly nested within each other like this:
在XHTML所有元素必须合理的相互嵌套像这样:
<b><i>This text is bold and italic</i></b>
Note: A common mistake in nested lists, is to forget that the inside list must be within a li element, like this:
注意:在列表嵌套的时候经常会犯一个错误,就是忘记了在列表中插入的新列表必须在一个<li>标记中,像这样:
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
<li>Milk</li>
</ul>
This is correct:
这才是正确的:
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
Notice that we have inserted a </li> tag after the </ul> tag in the "correct" code example.
在这段正确的代码示例中,要注意在</ul>之后加了一个</li>标签