1

我想做这样的文字:

http://www.picz.ge/img/s4/1303/22/3/33efdad184ec.jpg

看起来像这样:

texttext:      textttt
ttttttttttt:   ttt215555
textt:         trtrtrt

但是当我尝试时,它看起来像这样:

texttext: textttt
ttttttttttt: ttt215555
textt: trtrtrt

我目前正在使用的代码:

<div class="aligncenter" style="width: 700px; height: 1px; border-top: 1px dotted #999999; font-size: 0;">-</div>
Hours: Mon - Sun: 3:00 pm - 6:00 am Phone: 777777777777 Address: asd str. #14
<div class="aligncenter" style="width: 700px; height: 1px; border-top: 1px dotted #999999; font-size: 0;">-</div>

我已经这样解决了(wordpress):http: //jsfiddle.net/SEcfh/

<table border="0" align="left">
<tbody>
<tr>
<td style="width: 80px;">Phone:</td>
<td>+999 999 999 999</td>
</tr>
<tr>
<td style="width: 80px;">Phone:</td>
<td>+999 999 999 999</td>
</tr>
<tr>
<td style="width: 80px;">Phone:</td>
<td>+999 999 999 999</td>
</tr>
</tbody>
</table>
4

4 回答 4

1

您可以使用white-space: prewhite-space: pre-wrap保留文本中的空格。<table>您还可以对表格数据使用带有 s 的布局,或<dl> / <dt> / <dd>使用固定宽度术语的定义列表设置。

于 2013-03-22T19:37:13.220 回答
1

您可能不想使用white-space: pre,因为您必须手动在文本中添加适量的空格。

使用具有一定宽度的跨度,包裹在宽度为 2x 的 div 中,您可以轻松实现此目的。见这里:http: //jsfiddle.net/qaTDN/

于 2013-03-22T19:40:38.770 回答
0

这是表格数据,为什么不把它放在一个<table>?

于 2013-03-22T20:19:00.663 回答
0

要在一定宽度后换行或换词,您可以使用此 CSS 标记:

word-wrap:断词;

于 2013-03-23T06:08:32.000 回答