为什么< li>没有< / li>保持打开状态html嵌套列表 [英] why <li> is kept open without a </li> html nested lists
问题描述
我发布了一个问题,每个人都说过我并不真正问
的事情,我会尽量在下次更清楚。
我被告知当嵌套列表时,您必须保留< li>
,而不要< / li>
<<<<<<<<<<<<<<<<指向标签。
这就是我需要某人解释的...我被告知这是必要的,我找不到一个资源告诉我为什么。
< ul>
< li>路易斯< / li>
< li>路易斯·路易斯(Louis)
< ol>
< li>路易斯< / li>
< li>路易斯< / li>
< ul>
< li>路易斯< / li>
< li>路易斯< / li>
< ol>
< li>路易斯< / li>
< li>路易斯< / li>
< / ol>
< / ul>
< / ol>
< / li> <<<<<<<<<<
< / ul>
/ em>。
每个东西都由一个列表项目表示。
嵌套列表是这样的事情。它必须是列表项的一部分,以便它可以在另一个列表中。
如果您修正示例中的错误并缩进它,可能会更容易理解
$ b
li {background:#faa; padding:2px; margin-top:2px; margin-bottom:2px;} li li {background:#afa;}李丽li {background:#aaf;} li li li li {background:white;}
< ul> <李>路易斯< /锂> < li> Louis< ol> <李>路易斯< /锂> < li> Louis< ul> <李>路易斯< /锂> < li> Louis< ol> <李>路易斯< /锂> <李>路易斯< /锂> < /醇> < /锂> < / UL> < /锂> < /醇> < / li>< / ul>
对于列表项可以始终省略。 有些标签只是HTML中的可选项。当解析器碰到列表的结束标签或下一个列表项的开始标签时,该元素将结束。
I posted a question and everyone said things that i was not really asking I will try to be more clear next time.
I was told that when nesting lists you must leave a <li>
without a </li>
The <<<<<<<<<<<< point to the tags.
That is what i need someone to explain... I was told this is necessary and i can't find a resource that tells me why.
<ul>
<li> Louis </li>
<li> Louis <<<<<<<<<<<<<
<ol>
<li> Louis </li>
<li> Louis </li>
<ul>
<li> Louis </li>
<li> Louis </li>
<ol>
<li> Louis </li>
<li> Louis </li>
</ol>
</ul>
</ol>
</li> <<<<<<<<<<
</ul>
A list of a list of things.
Each thing is represented by a list item.
The nested list is such a thing. It has to be part of a list item so that it can be in another list.
It might be easier to understand if you fix the errors in your example and indent it properly.
li {
background: #faa;
padding: 2px;
margin-top: 2px;
margin-bottom: 2px;
}
li li {
background: #afa;
}
li li li {
background: #aaf;
}
li li li li {
background: white;
}
<ul>
<li>Louis</li>
<li>Louis
<ol>
<li>Louis</li>
<li>Louis
<ul>
<li>Louis</li>
<li>Louis
<ol>
<li>Louis</li>
<li>Louis</li>
</ol>
</li>
</ul>
</li>
</ol>
</li>
</ul>
The end tag for a list item can always be omitted. Some tags are simply optional in HTML. The element will be ended when the parser hits a end end tag for the list or a start tag for the next list item.
这篇关于为什么< li>没有< / li>保持打开状态html嵌套列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!