2017-04-07 71 views
0

我在我的html頁面中使用了<pre>標記,但未顯示完整行。我想顯示低於行hwole二: HTML預標記未顯示全行

 
    Hello Wish you all the best. This is just a testing of multiline as it is cutting the print work order.Multi formatting within email notifications and work order comments/notes 
    End Line. Last Comment. 

但它只是顯示

<pre> 
    Hello Wish you all the best. This is just a testing of multiline as 
    End Line. Last Comment. 
    </pre> 

是否預先標記有固定widht什麼?任何建議都會受到歡迎。

回答

1

下面是你給出的代碼,用pre標籤包裝。從我家看起來很好。

<pre> 
 
Hello Wish you all the best. This is just a testing of multiline as it is cutting the print work order.Multi formatting within email notifications and work order comments/notes 
 
    End Line. Last Comment. 
 
    </pre>

2

您將需要隱藏的東西溢出的情況下,溢出藏展現出來。這將添加一個滾動條。

pre { 
    overflow: auto; 
} 

或者如果滾動不是選項,您將需要包裝pre標籤。爲此使用

pre { 
    white-space: pre-wrap; 
} 

現在行將包裝並顯示在下一行,同時仍保持空白。