[b]在 github 的代码浏览页面,可以看到这样的 css 样式:[/b]
[b]显示效果:[/b]
[b]重点:[/b]
多个空格缩进的效果是由: white-space: pre; 控制的。
——————————————————————————————————————————————————————————————
[b]语法:[/b]
[b]Definition and Usage[/b]
The [color=indigo][i]white-space[/i][/color] property specifies how white-space inside an element is handled.
[b]Property Values[/b]
[table]
| [b] __Value__ [/b] |[b] __Description__ [/b]|
| [color=darkblue][i]normal[/i][/color] |Sequences of whitespace will collapse into a single whitespace.
Text will wrap when necessary. This is default|
| [color=darkblue][i]nowrap[/i][/color] |Sequences of whitespace will collapse into a single whitespace.
Text will never wrap to the next line. The text continues on the same line until a BR tag is encountered|
| [color=darkblue][i]pre[/i][/color] |Whitespace is preserved by the browser. Text will only wrap on line breaks. Acts like the PRE tag in HTML|
| [color=darkblue][i]pre-line[/i][/color] |Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks|
| [color=darkblue][i]pre-wrap[/i][/color] |Whitespace is preserved by the browser. Text will wrap when necessary, and on line breaks|
[/table]
REF: http://www.w3schools.com/cssref/pr_text_white-space.asp
-
<td class="blob-code-inner">
<span class="pl-k">throw</span>
<span class="pl-k">new</span>
<span class="pl-en">Error</span>(
<span class="pl-s">
<span class="pl-pds">"</span>
Chartbeat: Please specify an api key and host!
<span class="pl-pds">"</span>
</span>);
</td>
<style>
.blob-code-inner {
overflow: visible;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
color: #333;
word-wrap: normal;
white-space: pre;
</style>
[b]显示效果:[/b]
// 注意:前面是有多个空格缩进的。
throw new Error("Chartbeat: Please specify an api key and host!");
[b]重点:[/b]
多个空格缩进的效果是由: white-space: pre; 控制的。
——————————————————————————————————————————————————————————————
[b]语法:[/b]
[b]Definition and Usage[/b]
The [color=indigo][i]white-space[/i][/color] property specifies how white-space inside an element is handled.
[b]Property Values[/b]
[table]
| [b] __Value__ [/b] |[b] __Description__ [/b]|
| [color=darkblue][i]normal[/i][/color] |Sequences of whitespace will collapse into a single whitespace.
Text will wrap when necessary. This is default|
| [color=darkblue][i]nowrap[/i][/color] |Sequences of whitespace will collapse into a single whitespace.
Text will never wrap to the next line. The text continues on the same line until a BR tag is encountered|
| [color=darkblue][i]pre[/i][/color] |Whitespace is preserved by the browser. Text will only wrap on line breaks. Acts like the PRE tag in HTML|
| [color=darkblue][i]pre-line[/i][/color] |Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks|
| [color=darkblue][i]pre-wrap[/i][/color] |Whitespace is preserved by the browser. Text will wrap when necessary, and on line breaks|
[/table]
REF: http://www.w3schools.com/cssref/pr_text_white-space.asp
-