[thelist] Headers within ordered list in xhtml?

Brian Cummiskey Brian at hondaswap.com
Mon Feb 28 15:44:29 CST 2005


Stephen Rider wrote:

> According to this: <http://www.w3.org/TR/REC-html40/struct/lists.html> 
> you can use the "value" attribute to continue a numbering sequence.  
> This appears to be valid in xhtml.

Transitional, yes.  Strict, no.



There's no "strict" way around it that I know of.  However, you *CAN* 
hack it.

make your list, and on the ones where there is to be a header, give it 
an inline style with a large top margin-


li.bigtopmargin { margin-top: 4em; }


<ol>
<li class="bigtopmargin">blah</li>
<li>asd</li>
<li class="bigtopmargin">blah</li>
<li>dasdas</li>
</ol>


now, using an absolute positioned Div, you can fill in the margin space...


<div id="listheading1" style="position: absolute; top: 20px; left; 
50px;>Title 1</div>

or where ever you need it to be lined up into the margin'ed space.


This isn't perfect, and will fail miserably in a fluid design or bad 
browsers, but it will work under some circumstances and fixed width 
layouts.  The list bullet/number may also be a headache in positioning.

Just throwing out the idea...





More information about the thelist mailing list