對(duì)于多行代碼時(shí)使用<pre>標(biāo)簽。確保在代碼中避開所有尖括號(hào)以正確呈現(xiàn)。
<!DOCTYPE HTML>
<html>
<head>
<link href="//www.15014759268.cn/style/bootstrap.min.css" rel="stylesheet">
</head>
<body style="margin:20px;">
<pre><p>Sample text here...</p></pre>
</body>
</html>
你可以選擇添加 .pre-scrollable
類,它將設(shè)置最大高度為350像素的y軸滾動(dòng)條。
<!DOCTYPE HTML>
<html>
<head>
<link href="//www.15014759268.cn/style/bootstrap.min.css" rel="stylesheet">
</head>
<body style="margin:20px;">
<pre class="pre-scrollable">
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
<p>Sample text here...</p>
</pre>
</body>
</html>
更多建議: