& ensp采用等宽字体 [英] &ensp in a monospaced font

查看:354
本文介绍了& ensp采用等宽字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想用等宽字体输出一些html,我想要空格

占用与任何其他角色相同的宽度。我认为这对于等宽字体来说很容易

- 肯定是& ensp;和& emsp;两个都是一样的

宽度?


遗憾的是没有 - & ensp;比其他角色和& emsp更窄;是
更宽: - (


所以如何生成一系列正常宽度的空间?


我不能使用< pretag,因为输出中有HTML标记 - 它是

不仅仅是纯文本


Andy

解决方案

2月29日上午9:38,Andy Fish< ajf ... @ blueyonder.co.ukwrote:
< blockquote class =post_quotes>



我试图以等宽字体输出一些html,我想要空格

take与任何其他角色的宽度相同。我认为这对于等宽字体来说很容易

- 肯定& ensp;和& emsp;两者都是相同的

宽度?


遗憾的是没有 - & ensp;比其他角色和& emsp更窄;

更宽:-(


所以我如何生成一系列正常宽度的空格?


我不能使用< pretag,因为有HTML标记在输出中 - 它是

不仅纯文本


Andy



也许& nbsp;


Andy Fish写道:


我不能使用< pretag因为输出中有HTML标记 -

它不仅是纯文本



您可以在< pre>中使用标记。


-

Toby A Inkster BSc(荣誉)ARCS

[极客HTML / SQL / Perl / PHP / Python / Apache / Linux]

[操作系统:Linux 2.6.17.14-mm-desktop-9mdvsmp,上升30天,22:37。]


瓶装水
http://tobyinkster.co .uk / blog / 2008/02/18 /瓶装水/


2008年2月29日星期五,Andy Fish写道:
< blockquote class =post_quotes>
我试图以等宽字体输出一些html,我想要空格

占用与任何其他字符相同的宽度。我认为这对于等宽字体来说很容易

- 肯定是& ensp;和& emsp;两者都是一样的

宽度?



有些东西在等宽字体中毫无意义。想想所有具有零宽度的

字符。在他们的名字。


遗憾的是没有 - & ensp;比其他角色和& emsp更窄;

更宽:-(



In * which * font?

浏览器也可以从其他字体中获取ensp和emsp




-

In memoriam Alan J. Flavell
http ://groups.google.com/groups/sear...Alan.J.Flavell


Hi,

I am trying to output some html in monospaced font, and I want spaces to
take up the same width as any other character. i thought this would be easy
for monospaced fonts - surely &ensp; and &emsp; would both be the same
width?

unfortunately not - &ensp; is narrower than other characters and &emsp; is
wider :-(

so how do i generate a sequence of normal width spaces?

I can''t use the <pretag because there is HTML markup in the output - it''s
not only plain text

Andy

解决方案

On Feb 29, 9:38 am, "Andy Fish" <ajf...@blueyonder.co.ukwrote:

Hi,

I am trying to output some html in monospaced font, and I want spaces to
take up the same width as any other character. i thought this would be easy
for monospaced fonts - surely &ensp; and &emsp; would both be the same
width?

unfortunately not - &ensp; is narrower than other characters and &emsp; is
wider :-(

so how do i generate a sequence of normal width spaces?

I can''t use the <pretag because there is HTML markup in the output - it''s
not only plain text

Andy

maybe &nbsp;


Andy Fish wrote:

I can''t use the <pretag because there is HTML markup in the output -
it''s not only plain text

You can use markup within <pre>.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 30 days, 22:37.]

Bottled Water
http://tobyinkster.co.uk/blog/2008/02/18/bottled-water/


On Fri, 29 Feb 2008, Andy Fish wrote:

I am trying to output some html in monospaced font, and I want spaces to
take up the same width as any other character. i thought this would be easy
for monospaced fonts - surely &ensp; and &emsp; would both be the same
width?

Some things are meaningless in monospaced fonts. Think of all the
characters that have "zero-width" in their names.

unfortunately not - &ensp; is narrower than other characters and &emsp;
is wider :-(

In *which* font?
It is also possible that the browser takes ensp and emsp
from some other font.

--
In memoriam Alan J. Flavell
http://groups.google.com/groups/sear...Alan.J.Flavell


这篇关于&amp; ensp采用等宽字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆