Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old October 9th, 2006, 09:25 PM
pipehappy
Guest
 
Posts: n/a
Default about <ul>

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>

  #2  
Old October 9th, 2006, 09:45 PM
Els
Guest
 
Posts: n/a
Default Re: about <ul>

pipehappy wrote:
Quote:
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!
Quote:
<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/
  #3  
Old October 9th, 2006, 09:55 PM
prac
Guest
 
Posts: n/a
Default Re: about <ul>

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
---------------------

  #4  
Old October 9th, 2006, 10:05 PM
Els
Guest
 
Posts: n/a
Default Re: about <ul>

prac wrote:
Quote:
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/
  #5  
Old October 10th, 2006, 08:15 AM
David Dorward
Guest
 
Posts: n/a
Default Re: about <ul>

prac wrote:
Quote:
<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
  #6  
Old October 10th, 2006, 12:15 PM
Andy Dingley
Guest
 
Posts: n/a
Default Re: about <ul>


prac wrote:
Quote:
<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.

  #7  
Old October 10th, 2006, 05:15 PM
Jobe
Guest
 
Posts: n/a
Default Re: about <ul>

Andy wrote:
Quote:
>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:
Quote:
prac wrote:
>
Quote:
<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.
  #8  
Old October 10th, 2006, 05:45 PM
Michael Stemper
Guest
 
Posts: n/a
Default Re: about <ul>

In article <1160497549.712327.128120@e3g2000cwe.googlegroups. com>, Jobe writes:
Quote:
>Andy wrote:
Quote:
Quote:
>>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 :)
Quote:
><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.

  #9  
Old October 10th, 2006, 07:25 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: about <ul>

Jobe wrote:
Quote:
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.
  #10  
Old October 10th, 2006, 07:35 PM
VK
Guest
 
Posts: n/a
Default Re: about <ul>


Andy Dingley wrote:
Quote:
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)

  #11  
Old October 10th, 2006, 07:55 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: about <ul>

VK wrote:
Quote:
Andy Dingley wrote:
Quote:
>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.
  #12  
Old October 10th, 2006, 08:15 PM
VK
Guest
 
Posts: n/a
Default Re: about <ul>

Is not the OP's problem was with:
Quote:
Quote:
...
<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.

  #13  
Old October 10th, 2006, 08:25 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: about <ul>

VK wrote:
Quote:
Quote:
Quote:
>>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.
???
Quote:
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.
Quote:
Is unmatched *closing* tag breaks
well-formedness? If so, then it can be the answer.
It *was* the answer.
  #14  
Old October 10th, 2006, 08:35 PM
VK
Guest
 
Posts: n/a
Default Re: about <ul>


Harlan Messinger wrote:
Quote:
Quote:
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.

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles