Version-//W3C//DTD XHTML 1.0 Transitional//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; scr ipt 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
width CDATA #IMPLIEDone or more digits
xml:langNMTOKEN#IMPLIEDlanguage code (as per XML 1.0 spec); language code as RFC3066
xml:space( preserve )#FIXED 'preserve'
Content( #PCDATA | a | br | span | bdo | tt | i | b | u | s | strike | em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym | input | select | textarea | label | button | ins | del | script )*
End tagRequired </pre>
Referenced in applet blockquote body button center dd del div fieldset form iframe ins li map noframes 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
  );
 }
}
search Search · star Market
2023-06-19 · John December · Terms © johndecember.com