36 lines
1021 B
Markdown
36 lines
1021 B
Markdown
---
|
||
title: White Space Property
|
||
localeTitle: 白色空间财产
|
||
---
|
||
## 白色空间财产
|
||
|
||
white-space属性设置如何在单词之间显示空格。
|
||
|
||
#### 句法
|
||
|
||
白色空间:正常| nowrap |前|预行|预包装|继承
|
||
|
||
#### 例
|
||
```
|
||
p {
|
||
white-space: nowrap;
|
||
}
|
||
```
|
||
|
||
#### 值
|
||
|
||
正常:默认值。空白的序列将折叠成单个空格。必要时文本将换行。 Nowrap:空格的序列将折叠成一个空格。文本永远不会换行到下一行。 Pre:浏览器保留空白。文本仅包含换行符。像这样的行为
|
||
|
||
HTML中的标记。
|
||
预行:空白序列将折叠成单个空格。必要时文本将换行。
|
||
预包装:浏览器保留空白。必要时文本将换行。
|
||
Initial:将此属性设置为其默认值。
|
||
继承:从其父元素继承此属性。
|
||
|
||
#### 资源:
|
||
|
||
[W3schools的白色空间](https://www.w3schools.com/cssref/pr_text_white-space.asp)
|
||
|
||
#### 更多信息:
|
||
|
||
[MDN上的空白区域](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) 。 |