Full width home advertisement



Post Page Advertisement [Top]

HTML Preserve Formatting Tag

Sometimes, you want your text to follow the exact format of how it is written in the HTML document. In these cases, you can use the preformatted tag <pre>.

Any text between the opening <pre> tag and the closing </pre> tag will preserve the formatting of the source document.


<!DOCTYPE html>



<title>Preserve Formatting Example</title>




function myFunction( strText ){

alert (strText)





This will produce the following result:

function myFunction( strText ){

alert (strText)

Note: The above example is used to preserve a particular set of code the way it is expressed without formatting.

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib