我想创建一个简单的居中有序列表,如下所示:
1. one 2. three 3. fifteen 4. two
我正在尝试的所有内容都会使数字与左侧齐平,而不是停留在项目旁边的右侧。我如何得到上面的结果?
答案 0 :(得分:13)
使用
<style type="text/css">
.centered { text-align: center; list-style-position:inside;}
</style>
<ol class="centered">
<li>one</li>
<li>three</li>
<li>fifteen</li>
<li>two</li>
</ol>