HTML Pre Tag

Posted The: 28/05/2009 At: 14:31

The HTML pre element is used to markup preformatted text. Many sites are also using it to markup code examples, by replacing them with &gt; for ">" and &lt; for "<".

Attributes

Standard Attributes

Attribute:Value:Description:DTD:
AttrsOther AttributesCommon, Event, I18nSTF

DTD. Defines which document type the attribute is allowed. S=Strict, T=Transitional, F=Frameset.

Example

The below shows how to markup code in HTML pages, using pre tags.

 <pre>
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;

  &lt;head&gt;
    &lt;title&gt;My first Website&lt;/title&gt;
  &lt;/head&gt;

  &lt;body&gt;
    &lt;p&gt;My first Website.&lt;/p&gt;
  &lt;/body&gt;

&lt;/html&gt;
 </pre>

Comments: [0]

© Brugbart Webdesign