Version-//W3C//DTD XHTML 1.0 Strict//EN
Elementpre
Purposepreformatted text
DescriptionThis element brackets text which should be rendered exactly as it appears, that is without "eating up" the white space. This is used, for example, to enclose program code or tables where the indentation is important.
Start tagRequired <pre>
Attributes
NameTypeDefaultComment
class CDATA #IMPLIEDspace-separated list of classes
dir( ltr | rtl )#IMPLIEDdirection for weak/neutral text
idID#IMPLIEDdocument-wide unique id
langNMTOKEN#IMPLIEDlanguage code (backwards compatible); language code as RFC3066
onclick CDATA #IMPLIEDa pointer button was clicked; script expression
ondblclick CDATA #IMPLIEDa pointer button was double clicked; script expression
onkeydown CDATA #IMPLIEDa key was pressed down; script expression
onkeypress CDATA #IMPLIEDa key was pressed and released; script expression
onkeyup CDATA #IMPLIEDa key was released; script expression
onmousedown CDATA #IMPLIEDa pointer button was pressed down; script expression
onmousemove CDATA #IMPLIEDa pointer was moved within; script expression
onmouseout CDATA #IMPLIEDa pointer was moved away; script expression
onmouseover CDATA #IMPLIEDa pointer was moved onto; script expression
onmouseup CDATA #IMPLIEDa pointer button was released; script expression
style CDATA #IMPLIEDassociated style info; style sheet data
title CDATA #IMPLIEDadvisory title; text used for titles
xml:langNMTOKEN#IMPLIEDlanguage code (as per XML 1.0 spec); language code as RFC3066
xml:space( preserve )#FIXED 'preserve'
Content( #PCDATA | a | tt | i | b | big | small | em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym | sub | sup | br | span | bdo | map | ins | del | script | input | select | textarea | label | button )*
End tagRequired </pre>
Referenced in blockquote body button dd del div fieldset form ins li map noscript object td th
Example
SourceAppearance
<pre>

import java.awt.Graphics;
public class HelloWorld
extends java.applet.Applet {
public void init() {
resize(
200, 200
);
}
public void
paint(Graphics context) {
context.drawString(
"Hello, world!", 10, 50
);
}
}
</pre>
import java.awt.Graphics;
public class HelloWorld 
 extends java.applet.Applet {
 public void init() {
  resize(
   200, 200
  );
 }
 public void 
  paint(Graphics context) {
  context.drawString(
   "Hello, world!", 10, 50
  );
 }
}
Save this page to any social bookmarking site! Share · Search · Market · Directory
2015-11-01 · John December · Contact · Terms of Use © December Communications, Inc.