SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
Thread: Paragraphs and Unordered Lists
-
Oct 25, 2006, 07:54 #1
- Join Date
- Sep 2006
- Location
- San Diego
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Paragraphs and Unordered Lists
(I couldn't decide if this thread was better suited for this forum or the Accessibility / Usability forum to please bear with me)
Something I have been thinking about lately is the proper way to use p tags with ul tags.
Generally, the way I would introduce an unordered list, or any list for that matter into a paragraph would be to close the paragraph, add the list, and then start a new paragraph, but it just dawned on me that does seem like the correct way of doing this, see example:
HTML Code:<p>This is an interesting paragraph, huh? I'll introduce the list now:</p> <ul> <li>here</li> <li>is a</li> <li>list</li> </ul> <p>Please, let me finish talking about this list</p>
HTML Code:<p>This is an interesting paragraph, huh? I'll introduce the list now: <ul> <li>here</li> <li>is a</li> <li>list</li> </ul> Please, let me finish talking about this list</p>
San Diego Freelance Web Development Contractor
Great Taste, no Filler. Now with no Trans Fat!
-
Oct 25, 2006, 08:00 #2
- Join Date
- Dec 2002
- Location
- Aylmer, QC, Canada
- Posts
- 409
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by rhlowe
-
Oct 25, 2006, 08:17 #3
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
technically, the list is not part of the paragraph (a P may contain only inline elements)
so the first method is correct
-
Oct 25, 2006, 08:27 #4
- Join Date
- Sep 2006
- Location
- San Diego
- Posts
- 116
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
^^^ ah-ha
Well, you know what they say about conventional wisdom, or do you?
Anyways, that was my next venue of search for a definitive answer, so thanks, I'll remain using the old method.San Diego Freelance Web Development Contractor
Great Taste, no Filler. Now with no Trans Fat!
-
Oct 25, 2006, 09:19 #5
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A list doesn't make sense, semantically, within a paragraph. The validator will send death threats your way for the second method.
Birnam wood is come to Dunsinane
-
Oct 25, 2006, 11:21 #6
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Death threats? I thought it only billed you for an arm, a leg, and your first born?
But yeah, lists are not a part of a paragraph. Think about it. Would you expect to find a list inside a paragraph in a book or newspaper? Nope. Between them, yes. But never inside them.Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Oct 26, 2006, 11:59 #7
- Join Date
- Jul 2006
- Location
- Florida
- Posts
- 118
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's not valid xhtml to have a <ul> element contained within <p> tags.
-
Oct 26, 2006, 22:59 #8
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No, it's not, because it doesn't make sense. That's what we've been trying to say in this thread.
BTW, it's not valid HTML either.Birnam wood is come to Dunsinane
-
Oct 26, 2006, 23:31 #9
- Join Date
- Oct 2005
- Location
- Brisbane, QLD
- Posts
- 4,067
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I can understand why some might think a list is part of a paragraph because a lot of times a list can be written inline and then it is part of the paragraph, e.g.:
Please bring the following items: pen, pencil, paper and calculator.
-
Oct 27, 2006, 03:19 #10
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I know, but that is taking it in absurdum. As with anything else, there are those who go overboard with 'semantics'. I've seen examples where people wanted to mark up a document as an ordered list of paragraphs.
I'd say your example paragraph contains an enumeration, but not a real list.Birnam wood is come to Dunsinane
-
Oct 27, 2006, 03:50 #11
- Join Date
- Dec 2004
- Location
- Derbyshire - UK
- Posts
- 2,651
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
In that case would it make sense to use:
Code:<p> Please bring the following items: </p> <ul> <li>pen,</li> <li>pencil,</li> <li>paper</li> <li>and calculator.</li> </ul>
-
Oct 27, 2006, 06:56 #12
- Join Date
- Apr 2002
- Location
- A Maze of Twisty Little Passages
- Posts
- 6,316
- Mentioned
- 60 Post(s)
- Tagged
- 0 Thread(s)
It depends wither it is an itemised list with an emphasized heading or a string of equipment separated by comma but loosely it could be one way but that looks nearer to string.
Bookmarks