473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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>

Oct 9 '06 #1
13 6824
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
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
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
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

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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: bearclaws | last post by:
I am looping through a list of categories and want to display the list horizontally (instead of vertically). I want to create a single row with 4 list items in each cell of the row. I thought...
1
by: Randall Sell | last post by:
OK, I am utterly stumped. The code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> ul {...
5
by: toylet | last post by:
Attached is some css codes for a website. It has 3 parts: top-bar, side-bar (on the left) and main-body. The top-bar has a mouseover menu called top-menu implemented via ul:hover. When the mouse...
4
by: abs | last post by:
Anybody has an idea how to get the <ul> element which is not nested in <li> element ? In other words I have several lists like this: <ul id="1"> <li>Aaaaaaaa</li> <li>Bbbbbbbb</li>...
2
by: Shaun | last post by:
Hello! I have a quick question regarding CSS and having it applied to all elements. I am trying to eliminate the gap between a paragraph and a list that usually occurs in html and I've found...
1
by: jasonchan | last post by:
How do you align <ol> and <ul> elements when they are contained in a floated box? Here is my website: http://geocities.com/jasonchan483/ Here's my problem. The markers of the lists are...
3
by: Man-wai Chang | last post by:
A 2 columns x 10 rows matrix input form <ul> <li> <ul> <li>item name 1 <li><input type="textbox" name="input_col_1_row_1"> <li><input type="textbox" name="input_col_1_row_2"> </ul> <li>
6
by: capricious | last post by:
Is it possible, so that when you do multiple <UL>'s to control how deep the UL's are marked? For example, it would defaultly look like this with multiple ULs and LIs: -- Code : Main...
2
by: Shahid | last post by:
Hi, I am parsing an .HTML file that contains following example code: <div> <p class="html_preformatted" awml:style="HTML Preformatted" dir="ltr" style="text-align:left"><span...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.