我想出的方法也许不是规范的(但只是因为我不相信有一种“规范”的方式来实现它),但它确实有效:
<style type="text/css" media="screen">
#container
{width: 50%;
margin: 0 auto;
}
ol,
ul {border: 1px solid #ccc;
width: 90%;
padding: 1.4em 0;
}
ol li,
ul li {background-color: #ccc;
margin-left: 20%;
}
ol li span.list-head,
ul li span.list-head
{background-color: #ffa;
float: left;
display: block;
width: 6em;
}
dl {border: 1px solid #ccc;
line-height: 1.4em;
padding: 1.4em 0 0 0;
}
dl dt {background-color: #ffa;
display: block;
margin: 0;
width: 10%;
}
dl dd {background-color: #fc0;
display: block;
margin: 0;
width: 88%;
margin-left: 11%;
position: relative;
top: -1.4em;
}
</style>
...
<div id="container">
<ol>
<li><span class="list-head">Foo:</span> bar.</li>
<li><span class="list-head">Bar:</span> baz.</li>
<li><span class="list-head">Baz:</span> foo.</li>
</ol>
<ul>
<li><span class="list-head">Foo:</span> bar.</li>
<li><span class="list-head">Bar:</span> baz.</li>
<li><span class="list-head">Baz:</span> foo.</li>
</ul>
<dl>
<dt>Foo:</dt>
<dd>bar.</dd>
<dt>Bar:</dt>
<dd>baz.</dd>
<dt>Baz:</dt>
<dd>foo.</dd>
</dl>
</div>
有一个工作演示:http://www.davidrhysthomas.co.uk/so/lists.html。