![]() ![]() Teletype ![]() | ||||
![]() |
<tt> opens teletype </tt> ends teletype The teletype tag creates typewriter-style text, set in a fixed-width font. Feel like you've heard that somewhere before? You probably have. The more popular <pre> tag also creates typewriter-style text. But there are some major differences between the two. Preformatted text is just that - preformatted; the line breaks are determined by hard returns (hitting the return key). If you don't indicate line breaks, you won't get any. The preformatted text will just trail off the right-hand side of the page. Tel etype, however, is treated like normal text. It can accommodate formatting tags, like <p> and <br>, and will automatically wrap, in accordance with the width of the browser window. The HTML for teletype would look something like this: <tt>Mom and Dad, And would look like this: Mom and Dad, Since teletype is treated like normal text, it can be modified by other font tags or integrated into a line of normal text without being pushed onto a new line. So if your HTML looked like this: <p>My programs used to say <tt>"Hello, world!"</tt> Now they say <tt>"Bite me!"</tt>Your page would look like this: My programs used to say "Hello, world!" Now they say "Bite me!" So, basically, teletype is much like preformatted text, but with less hassle. You'll still want to use preformatted text when you honestly need to format the text. But if you're just looking for that retro-typewriter look, teletype is the way to go. Got a handle on it? Do it. | |||
Previously in HTML ...
Copyright © 1996 HotWired, Inc. All rights reserved. |