案例:CSS案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<style type="text/css">
4
p {white-space: pre-line;}
5
</style>
6
</head>
7
8
<body>
9
10
<p>This     paragraph has    a  great    many  s p a c e s   with
11
its textual  content, but their    collapse     will  not prevent
12
line   wrapping or line breaking.</p>
13
14
<p>注释:当 white-space 属性设置为 pre-line 时,浏览器会保留换行符,并允许自动换行,但是会合并空白符,这是与 pre-wrap 值的不同之处。</p>
15
16
</body>
17
18
</html>
19