Horje

How to create a pre-formatted text with a fixed width (with CSS)

See the Example and Learn More.

index.html
Example: HTML
<h2>Standard pre</h2>
<pre>This is a standard pre. It will use as much space as it needs.</pre>
<h2>Fixed width pre</h2>
<div style="width:200px;overflow:auto">
<pre>This is a pre with a fixed width. It will use as much space as specified.</pre>
</div>

Output should be:

How to create a pre-formatted text with a fixed width (with CSS)




Type :
html
Category :
Web Tutorial
Sub Category :
HTML Tag
Uploaded by :
Admin