[英]How to insert a line break without a br tag
您可以使用 HTML 在<pre>
標記</pre>
內按 Enter 鍵。
在 CSS 中,您可以使用white-space:pre
或white-space:pre-wrap
在編程中使用換行符\\n
JS Bin 示例: http : //jsbin.com/simeri/edit?html,output
<p style='white-space:pre-wrap;text-align:center;font:bold 130% sans-serif'>
Google Fonts. Hundreds of free, open-source fonts optimized for the web...
Search or browse hundreds of font families, then add the ones you like to your ..
</p>
您可以使用 css word-wrap 屬性,如下所示:
width: 200px; /*width of area after you want line break*/
word-wrap: break-word; /*break down the paragraph/text*/
或在您的代碼中動態使用 \\n。
<!DOCTYPE html><html><body>
<p style=' white-space: pre-line;text-align:center;font:bold 100% sans-serif'>
Google Fonts. Hundreds of free, open-source fonts optimized for the web...
Search or browse hundreds of font families, then add the ones you like to your ..
</p>
</body></html>
你能用 ..嗎?
<p> </p>
這就是 Canvas LMS 中的工作原理...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.