By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

about <ul>

P: n/a
Hi

I search around and find there are many discussion about
<ul><li><p>something</p></li></ul>. But I cannot find solution to <ul>
itself. I pass the following html through validate.w3.org. and it
always report error of misuse of <ul>. Could someone tell me the
solution to this problem? Thanks!

-----------------------------
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
<title>some</title>
</head>

<body>

<p>some
<ul>
<li><p>structured network components</p></li>
</ul>
</p>

</body>
</html>

Oct 9 '06 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Els
pipehappy wrote:
Hi

I search around and find there are many discussion about
<ul><li><p>something</p></li></ul>. But I cannot find solution to <ul>
itself. I pass the following html through validate.w3.org. and it
always report error of misuse of <ul>. Could someone tell me the
solution to this problem? Thanks!
<p>some
<ul>
<li><p>structured network components</p></li>
</ul>
</p>
You can't have a <ulinside a <p>.

Try this:

<p>some</p>
<ul>
<li><p>structured network components</p></li>
</ul>

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Oct 9 '06 #2

P: n/a
Hello,
<pis a block tag. And inside a block tag you cannot put a list !!

simply change like this, it will be "This Page Is Tentatively Valid
XHTML 1.0 Strict"
(message of w3c validator)

<body>
<p>some</p>
<ul>
<li><p>structured network components</p></li>
</ul>
</body>

I hope this help you

---------------------
http://philippe.chappuis.googlepages.com
---------------------

Oct 9 '06 #3

P: n/a
Els
prac wrote:
Hello,
<pis a block tag. And inside a block tag you cannot put a list !!
<divis a block element. And inside <divI can certainly put a list.
You can't have a list inside a paragraph, but that's not because <p>
is a block element.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Oct 9 '06 #4

P: n/a
prac wrote:
<pis a block tag. And inside a block tag you cannot put a list !!
Wrong. The <pelement is defined as only being able to contain inline
elements, which is why it cannot contain lists (since they are block
elements). Most block elements can contain other block elements.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Oct 10 '06 #5

P: n/a

prac wrote:
<pis a block tag. And inside a block tag you cannot put a list !!
"It's a block tag" is too simple an explanation of what's going wrong
here.

There are no "block tags" in HTML. There are elements that can (or
cannot) contain "block" elements, and there are elements that may (or
may not) behave as "block" elements. However the "inside and outside"
behaviour is independent. For some elements like <spanor <div>
they're the same - they both can contain the same thing as they
themselves are. For <pthough it behaves like a "block" element when
you're using it, but it can't itself _contain_ other "block" elements.
You can nest <div>s and you can nest <span>s, but you can't nesst <p>s.

Oct 10 '06 #6

P: n/a
Andy wrote:
>You can nest <div>s and you can nest <span>s, but you can't nesst <p>s.
We all understand what the initial problem is, and what the solution
is.
However sometimes words and expressions are used to explain and help,
which can be stuff for a new discussion:)

Andy stated that "you can't nest <p>'s.

Is the code below an example of nesting? If so...<p>'s can be nested :)
<head>
<style type="text/css">
..p1 {color:red;}
..p2 {color:green;}
</style>
</head>

<body>
<p class="p1">Something
<p class="p2">else</p></p>
</body>

Andy Dingley wrote:
prac wrote:
<pis a block tag. And inside a block tag you cannot put a list !!

"It's a block tag" is too simple an explanation of what's going wrong
here.

There are no "block tags" in HTML. There are elements that can (or
cannot) contain "block" elements, and there are elements that may (or
may not) behave as "block" elements. However the "inside and outside"
behaviour is independent. For some elements like <spanor <div>
they're the same - they both can contain the same thing as they
themselves are. For <pthough it behaves like a "block" element when
you're using it, but it can't itself _contain_ other "block" elements.
You can nest <div>s and you can nest <span>s, but you can't nesst <p>s.
Oct 10 '06 #7

P: n/a
In article <11**********************@e3g2000cwe.googlegroups. com>, Jobe writes:
>Andy wrote:
>>You can nest <div>s and you can nest <span>s, but you can't nesst <p>s.

We all understand what the initial problem is, and what the solution
is.
However sometimes words and expressions are used to explain and help,
which can be stuff for a new discussion:)

Andy stated that "you can't nest <p>'s.

Is the code below an example of nesting? If so...<p>'s can be nested :)
><body>
<p class="p1">Something
<p class="p2">else</p></p>
</body>
When the second paragraph begins, the first one is automatcially ended.
So, the second paragraph is not "nested" in the first one.

Later on, there is a superfluous tag, which will give a validation error.

--
Michael F. Stemper
The FAQ for rec.arts.sf.written is at:
http://www.geocities.com/evelynleeper/sf-written
Please read it before posting.

Oct 10 '06 #8

P: n/a
Jobe wrote:
Andy stated that "you can't nest <p>'s.

Is the code below an example of nesting? If so...<p>'s can be nested :)

<head>
<style type="text/css">
.p1 {color:red;}
.p2 {color:green;}
</style>
</head>

<body>
<p class="p1">Something
<p class="p2">else</p></p>
</body>
It's an example of nesting Ps and as such it's invalid. Where the
validator will discover this is when it reaches the second </p>. It
won't discover it at the second <pbecause the closing tag for a P is
optional, so the validator will impute a closing tag just before the
second opening tag because the first P element can't be closed any later
than that.
Oct 10 '06 #9

P: n/a
VK

Andy Dingley wrote:
There are no "block tags" in HTML. There are elements that can (or
cannot) contain "block" elements, and there are elements that may (or
may not) behave as "block" elements. However the "inside and outside"
behaviour is independent. For some elements like <spanor <div>
they're the same - they both can contain the same thing as they
themselves are. For <pthough it behaves like a "block" element when
you're using it, but it can't itself _contain_ other "block" elements.
You can nest <div>s and you can nest <span>s, but you can't nesst <p>s.
Is not the OP's problem was with:
....
<li><p>structured network components</p></li>
....
? I did not go to the Validator, so not sure at all, but that seems the
only anyhow questionnable construct.

In application to P tag it is a fancy matter, because originally the
Man did it as *paragraph break*, so there were line break BR and
paragraph break P (without closing tag in both cases). I said "there
were" but actually they still are. This did not prevent the Man to
become Sir :-) but W3C had a very hard time later to describe P in
terms of a block element with closing tag and at the same time to make
sure that a standard-compliant UA will not break on legacy pages where
P is nothing but "big BR". That is why by the amount of notes, mentions
and clarifications P has all times leadership among HTML tags in W3C
papers.

The final compromise was that P is a block element with closing tag but
it automatically ends up (closes up) before any other block element.
That is of course a weird behavior but seems as an overall smart
decision given that they had to incorporate cases like
Paragraph 1
<p>
Paragraph 2
<p>
Paragraph 3
(a legacy page with "paragraph breaks")

and

<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
(current style)

Oct 10 '06 #10

P: n/a
VK wrote:
Andy Dingley wrote:
>There are no "block tags" in HTML. There are elements that can (or
cannot) contain "block" elements, and there are elements that may (or
may not) behave as "block" elements. However the "inside and outside"
behaviour is independent. For some elements like <spanor <div>
they're the same - they both can contain the same thing as they
themselves are. For <pthough it behaves like a "block" element when
you're using it, but it can't itself _contain_ other "block" elements.
You can nest <div>s and you can nest <span>s, but you can't nesst <p>s.

Is not the OP's problem was with:
...
<li><p>structured network components</p></li>
There isn't anything wrong with that. The problem was the UL nested
inside the P.
Oct 10 '06 #11

P: n/a
VK
Is not the OP's problem was with:
...
<li><p>structured network components</p></li>

There isn't anything wrong with that. The problem was the UL nested
inside the P.
Then they maybe changed DTD for XHTML in application to P. By HTML
specs UL physically cannot be nested inside P: P block will be
automatically ended before opening UL tag, and after UL block we are
getting unmatched closing /P tag. Is unmatched *closing* tag breaks
well-formedness? If so, then it can be the answer.

Oct 10 '06 #12

P: n/a
VK wrote:
>>Is not the OP's problem was with:
...
<li><p>structured network components</p></li>
There isn't anything wrong with that. The problem was the UL nested
inside the P.

Then they maybe changed DTD for XHTML in application to P.
???
By HTML
specs UL physically cannot be nested inside P: P block will be
automatically ended before opening UL tag, and after UL block we are
getting unmatched closing /P tag.
Yes, Els, told the OP that 23 hours ago.
Is unmatched *closing* tag breaks
well-formedness? If so, then it can be the answer.
It *was* the answer.
Oct 10 '06 #13

P: n/a
VK

Harlan Messinger wrote:
Is unmatched *closing* tag breaks
well-formedness? If so, then it can be the answer.

It *was* the answer.
I really missed that post, so the above was my own guess. I'm glad it
was right - even if not needed anymore.

Oct 10 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.