How to wrapping text in a pre Tag with CSS code

How to Wrapping code in a <pre> tag with CSS

The HTML pre tag is used to insert preformatted text into HTML files and documents. Its used to display code blocks with using present lines breaks, characters and spaces.

HTML <pre> tag not allow to support text wrap, by default. If using <pre> tag in HTML code display horizontal scrollbar when code in large line. If need to read the whole line need to use a scroll bar.

For the problem of this solution define CSS. Let see below.

pre { 
overflow-x: auto; 
white-space: pre-wrap; 
white-space: -moz-pre-wrap; 
white-space: -pre-wrap; 
white-space: -o-pre-wrap; 
word-wrap: break-word;