pre {display:inline}的问题 [英] Problem with pre {display: inline}

查看:95
本文介绍了pre {display:inline}的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


我正在使用以下代码:


< html>

< head>

< style type =" text / css">

pre {display:inline;}

< / style>

< / head>

< body>

< div>< pre> hello< / pre world< / div>

< / body>

< / html>


IE6.0删除<后面的所有空格预阻塞和输出helloworld。 Opera

和Firefox在< preblock之后至少保留一个空格。如何在IE中解决这个问题?
< prein内联上下文需要输出所有

空格< preas is。


-

祝你好运,瓦迪姆。

解决方案

Scripsit Vadim Guchenko:


我'' m使用以下代码:



为什么?你正在使用< preand但是你希望它是内联的,也许只包含

,就像你的例子中的一个单词一样。你是否意识到在非CSS

浏览情况下会发生什么?你真的想要实现什么?像往常一样,

a URL会有所帮助(我们帮助你)。


< div>< pre> hello< / pre world< ; / DIV>



你__ally_得到了什么?


IE6.0删除< preblock和output之后的所有空格"的HelloWorld" ;.



IE 7也是如此。一个奇怪的错误,但为什么要调用它?


Opera和Firefox在< preblock之后至少保留一个空格。



一系列空格应相当于一个空格,所以我不知道

你的意思是至少 ;


< prein内联上下文需要

输出< preas中的所有空格。



不,不是。您可以使用< spanwith white-space:pre。但为什么你想要

来保留内联内容中的所有空格?


-

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


你好。


JKKWhy?你正在使用< preand但你希望它是内联的,也许

JKK包含

JKK就像你的例子中的一个词。你是否意识到发生了什么?

JKKnon-CSS

JKK浏览情况呢?你真的想要实现什么?


我想在一个容器中实现三件事:


1.等宽字体。我尝试使用< tttag和{font-family:monospace}

样式,但在Opera 9.02中,这样的固定宽度字体看起来比

可变宽度字体大。只有里面< prefixed-width字体看起来大小相同

作为Opera中的可变宽度字体。

2.容器内的所有空格必须按原样输出。 IE6和早期版本不支持{white-space:pre}



3.内联上下文。

< blockquote class =post_quotes>
>< div>< pre> hello< / pre world< / div>



JKK你__ally_得到了什么?


例如:


< style> pre {display:inline;边框:1px纯蓝色; background-color:

yellow}< / style>

< div>正则表达式可以是< pre> ^ hello world


< / preor

< pre> ^ goodbye world


Hello.

I''m using the following code:

<html>
<head>
<style type="text/css">
pre {display: inline;}
</style>
</head>
<body>
<div><pre>hello</pre world</div>
</body>
</html>

IE6.0 deletes all spaces after <preblock and outputs "helloworld". Opera
and Firefox retains at least one space after <preblock. How to resolve
this problem in IE? <prein inline context is needed for outputing all
spaces inside <preas is.

--
Best regards, Vadim.

解决方案

Scripsit Vadim Guchenko:

I''m using the following code:

Why? You''re using <preand yet you want it to be inline, perhaps containing
just one word as in your example. Do you realize what happens in non-CSS
browsing situations then? What are you _really_ trying to achieve? As usual,
a URL would help (us to help you).

<div><pre>hello</pre world</div>

What have you _really_ got?

IE6.0 deletes all spaces after <preblock and outputs "helloworld".

So does IE 7. A strange bug, but why do you want to invoke it?

Opera and Firefox retains at least one space after <preblock.

A sequence of spaces should be equivalent to one space, so I don''t know what
you mean by "at least".

<prein inline context is needed for
outputing all spaces inside <preas is.

No it isn''t. You can use <spanwith white-space: pre. But why do you want
to preserve all spaces in inline content?

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


Hello.

JKKWhy? You''re using <preand yet you want it to be inline, perhaps
JKKcontaining
JKKjust one word as in your example. Do you realize what happens in
JKKnon-CSS
JKKbrowsing situations then? What are you _really_ trying to achieve?

I want to achieve three things in one container:

1. Monospace font. I tried to use <tttag and {font-family: monospace}
style, but in Opera 9.02 such fixed-width font looks bigger than
variable-width font. Only inside <prefixed-width font looks the same size
as the variable-width font in Opera.
2. All spaces inside container must be outputed as is. {white-space: pre} is
not supported by IE6 and early versions.
3. Inline context.

><div><pre>hello</pre world</div>

JKKWhat have you _really_ got?

For example:

<style>pre {display: inline; border: 1px solid blue; background-color:
yellow}</style>
<div>The regular expression can be <pre>^hello world


</preor
<pre>^goodbye world


这篇关于pre {display:inline}的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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