SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Jun 19, 2009, 14:19 #1
- Join Date
- Jun 2005
- Posts
- 262
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Marking up a list of articles: Unordered list or definition list
Which do you think is most appropriate?
With H2 headers in list items:
Code:<h1>Electronics Articles</h1> <ul> <li> <h2>Article Title 1</h2> <p>Posted June 1, 2009</p> </li> <li> <h2>Article Title 2</h2> <p>Posted June 1, 2009</p> </li> </ul>
Code:<h1>Electronics Articles</h1> <ul> <li> Article Title 1 <span>Posted June 1, 2009</span> </li> <li> Article Title 2 <span>Posted June 1, 2009</span> </li> </ul>
Code:<h1>Electronics Articles</h1> <dl> <dt>Article Title 1</dt> <dd>Posted June 1, 2009</dd> <dt>Article Title 2</dt> <dd>Posted June 1, 2009</dd> </dl>
-
Jun 19, 2009, 16:03 #2
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'd probably go with the definition list.
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
-
Jun 19, 2009, 17:22 #3
- Join Date
- Jul 2006
- Location
- Augusta, Georgia, United States
- Posts
- 4,194
- Mentioned
- 17 Post(s)
- Tagged
- 5 Thread(s)
first and last split.
If the design requires a wrapping element for the term and definition pair you'll probably end with something more like this.
HTML Code:<dl> <dt>Article Title 1</dt> <dd>Posted June 1, 2009</dd> </dl> <dl> <dt>Article Title 2</dt> <dd>Posted June 1, 2009</dd> </dl>
if the below were possible though I would be all for the definition list.
HTML Code:<dl> <di> <dt>Article Title 1</dt> <dd>Posted June 1, 2009</dd> </di> <di> <dt>Article Title 2</dt> <dd>Posted June 1, 2009</dd> </di> </dl>
The only code I hate more than my own is everyone else's.
-
Jun 19, 2009, 17:25 #4
- Join Date
- Jun 2005
- Posts
- 262
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 19, 2009, 17:30 #5
- Join Date
- Jul 2006
- Location
- Augusta, Georgia, United States
- Posts
- 4,194
- Mentioned
- 17 Post(s)
- Tagged
- 5 Thread(s)
yeah I changed my mind as you'll see.
The only code I hate more than my own is everyone else's.
-
Jun 19, 2009, 17:39 #6
- Join Date
- Jun 2005
- Posts
- 262
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Dan Schulz and oddz, thanks for the helpful input. I'm now further along than I was.
-
Jun 19, 2009, 22:34 #7
- Join Date
- Jul 2008
- Location
- New York, NY
- Posts
- 1,432
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Before using a definition list, you should be aware that it may not be the best option in every case.
The <dt> within definition lists cannot contain block level elements – particularly the <hn> element. If content within a <dt> cannot be flagged as a heading, it cannot be given “heading” importance within the document hierarchy. Also, Google and other search engines will not index definition list content in the same way that they do for heading-based content.
Bookmarks