html两个单词之间的空格,HTML中单词之间的多个空格 - Multiple Spaces Between Words in HTML without   - 开发者知识库...

I'm using a barcode font "Free 3 of 9 Extended Regular" and the print out needs to have multiple spaces in some cases, to match the number of characters in the field. Example:

我使用的是条码字体“免费3 / 9的扩展规则”,打印输出需要在某些情况下有多个空格,以匹配字段中的字符数。例子:

*AA-XXXX *"

(four spaces follow the item number to make the 12 characters. The barcode reader will give me an error if there are less characters.

(在项目号后面加4个空格,构成12个字符。如果字符比较少,条形码阅读器会给我一个错误。

nbsp; will force multiple spaces, however, IE and Firefox both display those as standard font spaces and do not use the barcode font. The barcode displays as broken up between the non-space characters. (Incidentally, only IE 6 does display nbsp; in the proper font.) If I use a regular space, it trims the number of spaces down and displays only one.

,不过,IE和Firefox将强制使用多个空格作为标准字体空间,并且不使用条码字体。条码显示在非空格字符之间。(顺便说一句,只有IE 6显示了;在适当的字体。)如果我使用一个常规的空格,它会减少空格的数量,只显示一个空格。

Thanks in advance.

提前谢谢。

4 个解决方案

#1

64

Look at the white-space css property

看看空白css属性

Using

使用

.barcode{

white-space:pre; /* or pre-wrap if you want wrapping to still work. */

}

and

*AA-XXXX *"

will do the trick.

上大做文章。

.barcode{

font-family:Courier;

white-space:pre; /* or pre-wrap if you want wrapping to still work.*/

}

*AA-XXXX *"

外部演示:http://www.jsfiddle.net/gaby/Z3gkq/

#2

16

Use

 when whitespace is significant.

当空格重要时使用

#3

7

you can replace all spaces with  

您可以用 替换所有空格

#4

-1

I like to use this special white-space that HTML and JavaScript does not detect as white-space. ->" "

我喜欢使用HTML和JavaScript不能检测到的特殊空白。”- >“

It looks better on the code end too.

它在代码端看起来也更好。

UPDATE

更新

Looks like stack over flow replaces it with a regular space so here is the ASCII code for it

看起来堆栈/流将它替换为一个常规空间,这是它的ASCII代码

Dec 160 Hex A0 Oct 240

12月16日

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值