Bootstrap Tutorial - Bootstrap Pre








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>&lt;p&gt;Sample text here...&lt;/p&gt;</pre>
        
</body>
</html>

Click to view the demo





Scrollable Pre

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'>
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
&lt;p&gt;Sample text here...&lt;/p&gt;
</pre>
        
</body>
</html>

Click to view the demo