订购单号码位置

时间:2011-01-26 09:08:53

标签: html

我想实现这个目标:

1.Rod    The lazy dog.
2.Jane   The lazy cat.
3.Freddy The active goldfish.

然而,我明白了:

Rod      1. The lazy dog.
Jane     2. The lazy cat.
Freddy   3. The active goldfish.

这是我的HTML:

<head>
<title></title>
<style type="text/css">
    span
    {
        width: 60px;
        display: block;
        float: left;
        clear: left;
    }
</style>
</head>
<body>
    <ol>
        <li><span>Rod</span> The lazy dog.</li>
        <li><span>Jane</span> The lazy cat.</li>
        <li><span>Freddy</span> The active goldfish.</li>
    </ol>
</body>
</html>

如何在列表编号开头定位?

1 个答案:

答案 0 :(得分:2)

除了宽度和显示之外你不需要任何东西,实际上:

span 
{ 
    width: 60px; 
    display: inline-block; 
}

Tested,这适用于IE9,Chrome和Firefox。