white-space
white-space用来设置浏览器对“空白”的处理,所谓的空白指的是你在编辑器里面输入的空格,回车,tab等。他的可选内容如下:
normal: 默认。空白会被浏览器忽略。例如:开头结尾的空白忽略,字之间的,不管多少个多个空格或回车,只显示一个空格,换行前面的空格忽略
pre:空白会被浏览器保留。其行为方式类似 html 中的 e03b848252eb9375d56be284e690e873 标签。
nowrap:不换行,除非遇到df250b2156c434f3390392d09b1c9563,n个空格会被压缩为一个。
pre-wrap:保留所有空白,但是正常地进行换行(chrome,ff,ie8+,opera),在ie6和ie7下等同于normal
pre-line:合并空白符序列(合并成一个),但是保留换行符(chrome,ff,ie8+,opera),在ie6和ie7下面等同于normal
word-spacing与letter-spacing
word-spacing 只能作用于英文的单词与单词间,对于中文无效
letter-spacing 可以作用于中文。
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
<style type="text/css">
p.spread {letter-spacing: 30px;}
</style>
</head>
<body>
<p class="spread">this is some text.哈哈哈哈哈哈哈</p>
<p class="tight">this is some text.this is some text.</p>
</body>
</html>
以上就是详解css中的空白效果属性使用的详细内容。