白空间的帮助 [英] white-space help

查看:47
本文介绍了白空间的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个长文本文档粘贴到一个网页中并让它

保留所有的空格和换行符。


我第一次尝试了< pretag但是那不起作用,因为它没有b $ b包装文本。然后我转移到了CSS和白色空间属性,但是我不能让它继续工作。 white-space:pre和

< preand white-space一样:pre-wrap似乎不支持任何

浏览器我已经用。测试。我尝试了自动换行:break-word,但那是

只支持我的IE并且它搞砸了我的空白区域:无论如何。

* sigh *


任何人都可以向我建议我应该使用哪些属性和值来获得浏览器(主要是IE和Firefox)以保留空白和

换行,以及包装文本。


非常感谢你!


布伦特

I want to paste a lengthly text document into a web page and have it
retain all of whitespace and line breaks.

I first tried the <pretag but that didn''t work because it doesn''t
wrap the text. I then moved to CSS and the white-space property, but I
can''t seem to get it to work either. white-space: pre does the same as
<preand white-space: pre-wrap doesn''t seem to be supported by any
browsers I''ve tested with. I tried word-wrap: break-word, but that is
only supported my IE and it messed up my white-space: pre anyhow.
*sigh*

Can anyone suggest to me what properties and values I should use to get
the browsers (IE and Firefox, mostly) to preserve whitespace and
newlines, as well as wrapping the text.

Thank you so much!

Brent

推荐答案

布伦特< bk ******* @ gmail.comscripsit:
Brent <bk*******@gmail.comscripsit:

I想要将一个长文本文档粘贴到一个网页中并拥有它

保留所有空格和换行符。
I want to paste a lengthly text document into a web page and have it
retain all of whitespace and line breaks.



什么可能构成这种操作的需要?如果它是预先格式化的纯文本并且应该保持这种方式,它可以变成一个

纯文本www文件。


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/

What could possibly constitute the need for such an operation? If it''s
preformatted plain text and should be kept that way, it can be turned into a
plain text www document.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


布伦特写道:
Brent wrote:

我想将一个长文本文档粘贴到一个网页中并拥有它

保留所有空格和换行符。 />

我首先尝试了< pretag但是没有用,因为它没有

包装文本。
I want to paste a lengthly text document into a web page and have it
retain all of whitespace and line breaks.

I first tried the <pretag but that didn''t work because it doesn''t
wrap the text.



你希望它保留换行符并且不保留换行符。

我认为这就是你的难点所在。


-

jmm(连字符)列表(at)sohnen-moe(点)com

(删除电子邮件的.AXSPAMGN)

You want it to preserve the linebreaks and not preserve the linebreaks.
I think this is where your difficulty lies.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


2006-08-13,Jim Moe写道:
On 2006-08-13, Jim Moe wrote:

Brent写道:
Brent wrote:

>我想将长文本文档粘贴到网页上页面并拥有它
保留所有空格和换行符。

我首先尝试了< pretag但是没有用,因为它没有包装文本。
>I want to paste a lengthly text document into a web page and have it
retain all of whitespace and line breaks.

I first tried the <pretag but that didn''t work because it doesn''t
wrap the text.



您希望它保留换行符并且不保留换行符。

我认为这就是您的难点所在。

You want it to preserve the linebreaks and not preserve the linebreaks.
I think this is where your difficulty lies.



OPP的请求中没有任何不一致。他希望

现有的换行符保留,而不是加入下一行。他希望
需要很长的换行。


他想要的东西很难阅读,不推荐。


-

Chris FA Johnson< http://cfaj.freeshell.org>

=============== =================================== =============== ==

作者:

Shell Scripting Recipes:问题解决方案(2005,Apress)

There''s nothing inconsistent in the OPP''s request. He wants the
existing linebreaks to remain, and not join with the next line. HE
want long lines to wrap.

What he wants is very hard to read, and not recommended.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


这篇关于白空间的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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