我们可以在 <ul> 中使用任何其他 TAG 吗?随着<li>? [英] Can we use any other TAG inside <ul> along with <li>?
本文介绍了我们可以在 <ul> 中使用任何其他 TAG 吗?随着<li>?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以在
和 中使用任何其他 TAG 吗?
Can we use any other TAG in <ul>
along with <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>
推荐答案
为了使您的代码有效,除了 <li>
.
For your code to be valid you can't put any tag inside a <ul>
other than an <li>
.
但是,您可以将任何块级元素放在 中,如下所示:
You can however, put any block level element inside the <li>
, like so:
<ul>
<li>
<h2>...</h2>
<p>...</p>
<p>...</p>
</li>
</ul>
这篇关于我们可以在 <ul> 中使用任何其他 TAG 吗?随着<li>?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文