/

HTML / CSS / JavaScript Tutorial

HTML Element: <pre>

[this page | pdf | back links]

The HTML <pre> element indicates a piece of preformatted text. Typically the text is displayed in a fixed-width font (usually Courier), preserving both spaces and line breaks.

 

The attributes it can take are HTML global attributes and HTML event attributes. It used to support the width attribute, but this is no longer supported by HTML 5.

 

To create or access such an element in JavaScript see here. The corresponding HTML DOM object supports standard DOM properties and methods. The default style applicable to this element is shown here.

 


NAVIGATION LINKS
Contents | Prev | Next | HTML Elements


Desktop view | Switch to Mobile