CSS固定宽度跨度

时间:2012-08-27 19:12:34

标签: html css

我需要一个固定范围的示例:CSS fixed width in a span

引用:

<li><span></span> The lazy dog.</li>
<li><span>AND</span> The lazy cat.</li>
<li><span>OR</span> The active goldfish.</li>

并且作者希望:

    The lazy dog.
AND The lazy cat.
OR  The active goldfish.

但如果我早就离开了部分:

                 The lazy dog.
ANDDDDDDDDDDDDDD The lazy cat.
OR               The active goldfish.

但我真的需要:

                 The lazy dog.
ANDDDDDDDDDDDDDD The lazy cat.
              OR The active goldfish.

有可能吗?

1 个答案:

答案 0 :(得分:4)

这样的东西对你有用 尝试模仿表格显示

li{
   display:table-row;        
}
li span{
   display:table-cell;
   text-align:right;
   padding-right:5px;
}

demo