PRB: HTML Stops Displaying When a '<' Is Within <PRE> Tags (182669)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 3.0
  • Microsoft Internet Explorer (Programming) 3.01
  • Microsoft Internet Explorer (Programming) 3.02

This article was previously published under Q182669

SYMPTOMS

If you place a less-than symbol, "<", inside a pair of preformatting tags (<PRE></PRE>), the HTML stops displaying at the point where the "<" is listed in Internet Explorer 3.0x.

RESOLUTION

To work around this problem, either use <XMP> instead of <PRE> or use &lt instead of "<". Please note that <XMP> is considered obsolete by the World Wide Web Consortium (W3C) and may not be supported in future versions of Internet Explorer. For sample code that demonstrates these workarounds, see the "More Information" section.

MORE INFORMATION

Text placed within a preformatted section of HTML using <PRE> is usually displayed as-is, without any formatting. If the Web page that contains this preformatted text contains a less-than symbol (<) and the page is displayed in Internet Explorer 3.0x, Internet Explorer stops displaying the HTML on the Web page when it reaches the "<". Any HTML that is after the "<" is not displayed, even if it is outside of the preformatted section.

For example, in Internet Exlorer 3.0x, the HTML display stops at the "<":
<HTML>
   <BODY>
      <PRE>
         Some preformatted text
         x < y
      </PRE>
      This text will not be displayed
   </BODY>
</HTML>
				

Workaround

There are two workarounds to this problem. Use <XMP> instead of <PRE>. Please note that <XMP> is considered obsolete by the W3C and may not be supported in future versions of Internet Explorer:
<HTML>
   <BODY>
      <XMP>
         Some preformatted text
         x < y
      </XMP>
      This text will be displayed
   </BODY>
</HTML>
				
Or use &lt instead of "<".
<HTML>
   <BODY>
      <PRE>
         Some preformatted text
         x &lt y
      </PRE>
      This text will be displayed
   </BODY>
</HTML>
				

REFERENCES

To view the W3C HTML Specification, go to the following Web site: For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbnofix kbprb KB182669