Ordered list scenarios Feb27 '05
While exporting a Pages document to HTML, I noticed that <ol> has an attribute start. I had not known this up until this point.
The start attribute let’s the author specify what list number is used to begin the increment. For example:
<ol>
<li>iPod</li>
<li>U2 iPod</li>
<li>iPod Mini</li>
<li>iPod Photo</li>
<li>iPod Shuffle</li>
</ol>
... would output:
- iPod
- U2 iPod
- iPod Mini
- iPod Photo
- iPod Shuffle
However...
<ol start="3">
<li>iPod</li>
<li>U2 iPod</li>
<li>iPod Mini</li>
<li>iPod Photo</li>
<li>iPod Shuffle</li>
</ol>
... would output:
- iPod
- U2 iPod
- iPod Mini
- iPod Photo
- iPod Shuffle
block level vs. start
Let’s say I would like to turn this text into an ordered list:
- iPod
- U2 iPod
This iPod is covered in U2’s latest album colors, and contains many pre–loaded U2 songs.
- iPod Mini
- iPod Photo
- iPod Shuffle
Notice the brief description of the U2 iPod.
How would you markup this list, in HTML?
Would you simply imbed another block level element within the list item, such as:
<ol>
<li>iPod</li>
<li>U2 iPod
<blockquote><p>This iPod is covered in U2’s latest album colors, and contains many pre–loaded U2 songs.</p></blockquote>
</li>
<li>iPod Mini</li>
<li>iPod Photo</li>
<li>iPod Shuffle</li>
</ol>
Or... would you utilize the start attribute:
<ol>
<li>iPod</li>
<li>U2 iPod</li>
</ol>
<blockquote><p>This iPod is covered in U2’s latest album colors, and contains many pre–loaded U2 songs.</p></blockquote>
<ol start="3">
<li>iPod Mini</li>
<li>iPod Photo</li>
<li>iPod Shuffle</li>
</ol>
My preference
I prefer using the block level element inside the list item.
Categories: Markup
, Semantics
, XHTML ![]()
Add Feedback (view all)
Leave feedback
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Popular Pages
- Fast rounded corners in Photoshop (5892 recent visits)
- PHP – passing variables across pages (2153 recent visits)
- JavaScript set selected on load (1806 recent visits)
- Removing all child nodes from an element (1256 recent visits)
- iPod songs out of order? (1047 recent visits)
- Firefox 3 smart address bar: wildcard search (968 recent visits)
- Britney - Everytime piano tab (902 recent visits)
- MySQL LEFT JOIN syntax (758 recent visits)
- Breathe Me - Sia (678 recent visits)
- Tumblr: how blogging should be (559 recent visits)
Similar Entries
- Drop-down list of United States, Canada, and Mexico states or provinces (322 recent visits)
- AJAX select list issue in IE6 (73 recent visits)
- DHTML select list trouble, continued (105 recent visits)
- To-Do list and task manager web sites (29 recent visits)
- Removing static blogroll list (0 recent visits)
- Christmas list mediator (1 recent visits)
Stats
25 unique visits since August 2008
Recent Referrers (click)
- add level +pre ordered list
- ordered list html within 1.1
- ordered list html within 1.1
- html ordered list firefox
- ordered list html start xhtml 1.1
- ordered list level
- http://search.comcast.net/?cat
- HTML ordered lists 1.1
- ordered list html continue
- ordered list html continue
- html ol 1.1
- ordered list Firefox 3
- xhtml start attribute ordered list
- ordered list html 1.1
- ordered list Firefox 3
- Firefox "ordered list" ol syntax
- ordered list with 1.1 numbering in html
- ordered list 1.1
- html ordered list 1.01
Good, because apparently the start attribute has been deprecated in XHTML 1.1. Someone on the WSG mailing list pointed this out last year, citing ... Read more.