The HTML Elements reference.

"pre" - html element

  • This element shows preformatted text as it is included, with exactly specified whitespace, blank lines and such.
  • Starttag <pre> is Required and endtag </pre> is Required
  • Is useful for formatting computer code or poetry where whitespace is important.
  • Browsers that support the pre - element : Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari
Element "pre" example:
<PRE><CODE>// PRE element (using CODE) example with no use of attributes
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}</CODE></PRE>

Another element "pre" example:
<pre><font size='+2' color='red'>
         | Mon  | Tues | Wed  | Thurs | Fri
         |      |      |      |       |
Calculus |  X   |      |  X   |       |
------------------------------------------------------
English  |      |  X   |      |   X   |
------------------------------------------------------
Latin    |  X   |      |  X   |       |
</font></pre>


Attributes:
class , dir , id , lang , style , title , width (deprecated)

Attribute "class" value(s): A list of style class names that must be separated by white space characters.
  • This attribute assigns a style class name or set of style class names to an element. Any number of elements may be assigned the same class name or names.
  • You will find more about this in the CSS learning on this site.



© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.