FireFox and the CODE Tag

Minor thing I discovered this morning while testing a page in FireFox.  FireFox v1.5.0.6 does not support or recognize the <code> tag that people occasionally use to show an excerpt of source code.  (It won't render the text as monospace.)  In order to get the same effect across IE, Mozilla, and FireFox, use the <pre> tag instead.  If you want the browser to automatically wrap the lines of excerpted code, use a <font face=”courier”> tag.

This bit is in a <code> tag.

This bit is in a <pre> tag.

This longish bit of text is inside a <font face=”courier,lucida console,mono”> tag. This longish bit of text is inside a <font face=courier,lucida console,mono> tag. This longish bit of text is inside a <font face=courier,lucida console,mono> tag. This longish bit of text is inside a <font face=courier,lucida console,mono> tag. This longish bit of text is inside a <font face=courier,lucida console,mono> tag.


2 thoughts on “FireFox and the CODE Tag

  1. Huh. That's what I use and your code and pre tags above look exactly the same (except one says “code” and the other says “pre”).

  2. Now that's curious. It looks okay for me too now in FireFox. This morning I was reviewing another article in FireFox and it rendered the contents of a code tag in Times New Roman. Weird.
    Okay, nevermind I guess.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>