2014-07-18 57 views

回答

2

HTML之間有着換行符pre標記:用於預先打印文本。它將尊重輸入的格式。例如:

<pre> 
This... 
    will... 
stay like this. 
</pre> 

變爲(jsfiddle):

This... 
    will... 
stay like this. 
0

或者您可以使用空白:預線;看看DEMO

div{white-space:pre-line; } 

<div> 
This... 
will... 
stay like this. 
</div> 

注:對於保留換行符使用white-space:pre-line