Use <pre>
for multiple lines of code.
Be sure to escape any angle brackets in the code for proper rendering.
<!DOCTYPE HTML>
<html>
<head>
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
</head><!-- w w w . j a v a 2s . c om-->
<body style='margin:20px;'>
<pre><p>Sample text here...</p></pre>
</body>
</html>
You may optionally add the .pre-scrollable
class, which
will set a max-height of 350px and provide a y-axis scrollbar.
<!DOCTYPE HTML>
<html>
<head>
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
</head><!--from w w w . j ava 2 s . com-->
<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>