将UL放在段落中是否可以接受? [英] is it acceptable to put a UL inside of a paragraph??

查看:102
本文介绍了将UL放在段落中是否可以接受?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表列表,每个列表都有一个标题。我想将

标题与其列表分组。我能这样做吗:


< p>

< h5>我的头衔< / h5>

< ul> ;

< li>书籍< / li>

< li>狗< / li>

< / ul>

< / p>


< p>

< h5>习惯< / h5>

< ul>

< li> Dancing< / li>

< li> lauging< / li>

< / ul>

< / p>

解决方案

2004年10月1日10:01:53 -0700,劳伦斯< LK ****** @ geocities.com>写道:

我有一个列表列表,每个列表都有一个标题。我希望将
标题与其列表分组。我可以这样做:

< p>
< h5>我的标题< / h5>
< ul>
< li>书籍< / li>
< li>狗< / li>
< / ul>
< / p>




否P元素只允许内联元素。浏览器会将

视为

以下:


< p>< / p>

< h5>我的标题< / h5>

< ul>

< li> books< / li>

< ; li>狗< / li>

< / ul>


为什么在这种情况下完全使用P?


这是关于HTML基础知识的一个很好的教程:

http://www.htmlhelp.com/reference/html40/

-

Rijk van Geijtenbeek

网络是一种拖延装置:

它可以吸收尽可能多的时间来确保你不会得到
任何真正的工作。 - J.Nielsen


lawrence< lk ****** @ geocities.com>写道:

我有一个列表列表,每个列表都有一个标题。我希望将
标题与其列表分组。我可以这样做:

< p>
< h5>我的标题< / h5>
< ul>
< li>书籍< / li>
< li>狗< / li>
< / ul>
< / p>




否P元素不能包含块级元素,如H5和UL。它

只能包含内联(文本级)元素。


但由于这是列表列表,您可以嵌套列表:


< ul>

< li>

< h5>我的标题< / h5>

< ul>

< li> books< / li>

< li>狗< / li>

< ; / ul>

< / li>

...

< / ul>

- -

Darin McGrew, da***@TheRallyeClub.org http://www.TheRallyeClub.org/

噱头车拉力赛不是比赛,但是一个有趣的拼图测试你的

能否遵循指示。即将到来的噱头汽车拉力赛

硅谷:Monstah Mash 2004(10月2日星期六)


文章< da ***** *********************@posting.google.com> ;,劳伦斯写道:

我有一个列表列表,每个列表列表有一个标题。我希望将
标题与其列表分组。我可以这样做:




不,但这对我来说就像订购DIV一样。试试这个:


< div id =" Title">

< h5>我的标题< / h5>

< ul>

< li> books< / li>

< li>狗< / li>

< / ul>

< / div>


< div id =" Habits">

< h5> ;习惯< / h5>

< ul>

< li>跳舞< / li>

< li> lauging< / li>

< / ul>

< / div>


-

Michael F. Stemper

#include< Standard_Disclaimer>

如果是旅游季节,我在哪里获得许可证?


I have a list of lists, and each lists has a heading. I want the
heading to be grouped with its list. Can I do this:

<p>
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>
</p>

<p>
<h5>habits</h5>
<ul>
<li>dancing</li>
<li>lauging</li>
</ul>
</p>

解决方案

On 1 Oct 2004 10:01:53 -0700, lawrence <lk******@geocities.com> wrote:

I have a list of lists, and each lists has a heading. I want the
heading to be grouped with its list. Can I do this:

<p>
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>
</p>



No. The P element only allows inline elements. Browsers will treat the
above
as:

<p></p>
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>

Why use the P at all in such a case?

Here is a nice tutorial on HTML basics:

http://www.htmlhelp.com/reference/html40/

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won''t get any real work done. - J.Nielsen


lawrence <lk******@geocities.com> wrote:

I have a list of lists, and each lists has a heading. I want the
heading to be grouped with its list. Can I do this:

<p>
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>
</p>



No. The P element cannot contain block-level elements like H5 and UL. It
can contain only inline (text-level) elements.

But since this is "a list of lists", you can nest lists:

<ul>
<li>
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>
</li>
...
</ul>
--
Darin McGrew, da***@TheRallyeClub.org, http://www.TheRallyeClub.org/
A gimmick car rallye is not a race, but a fun puzzle testing your
ability to follow instructions. Upcoming gimmick car rallye in
Silicon Valley: Monstah Mash 2004 (Saturday, October 2)


In article <da**************************@posting.google.com >, lawrence writes:

I have a list of lists, and each lists has a heading. I want the
heading to be grouped with its list. Can I do this:



No, but this looks to me like it''s made to order for a DIV. Try this:

<div id="Title">
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>
</div>

<div id="Habits">
<h5>habits</h5>
<ul>
<li>dancing</li>
<li>lauging</li>
</ul>
</div>

--
Michael F. Stemper
#include <Standard_Disclaimer>
If it''s "tourist season", where do I get my license?


这篇关于将UL放在段落中是否可以接受?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆