我们可以使用任何其他标记在<ul>伴随着<li>?
喜欢
<ul>
Some text here or <p>Some text here<p> etc
<li>item 1</li>
Some text here or <p>Some text here<p> etc
<li>item 1</li>
</ul>
Run Code Online (Sandbox Code Playgroud) 可能重复:
在UL中是否允许除LI以外的任何内容?
我做的是这样的:
<ul>
<h3><a name="titlename">Title</a></h3>
<li>Text.</li>
<li>More text.</li>
<span><a href="/url">Click here</a> to go to some place.</span>
</ul>
Run Code Online (Sandbox Code Playgroud)
但我在视觉工作室收到警告:
Warning Validation (HTML5): Element 'h3' cannot be nested within element 'ul'.
Warning Validation (HTML5): Element 'span' cannot be nested within element ?ul'.
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索,发现看起来像是另一个标签但<li>在<ul>ю 里面不是问题
但无论如何可能有人对此有任何意见.它会破坏什么吗?你把<h>标签或任何其他标签放在里面<ul>?你有什么经历?