Learn HTML step-by-step from A to Z or improve your professional skills.  Home HTML and CSS Tutorials Using Teletype
Your Ad Here

Using Teletype


Using Teletype<tt> opens teletype
</tt> ends teletype

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. Tele type, 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,

<p>Work is good. Thanks for the shirts. I'm not sure how to tell you this, but, well, I'm quitting my job to pursue professional broomball. This Web stuff wasn't really my thing.

<p>Could you send a few extra dollars my way? I have an appointment to get my shoulder reset, and they make you pay up front.

<p>Your loving son,<br>
Luke </tt>

And would look like this:

Mom and Dad,

Work is good. Thanks for the shirts. I'm not sure how to tell you this, but, well, I'm quitting my job to pursue professional broomball. This Web stuff wasn't really my thing.

Could you send a few extra dollars my way? I have an appointment to get my shoulder reset, and they make you pay up front.

Your loving son,
Luke

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.

I hope this came in useful!


Author's URL: WebMonkey
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

HTML is Hyper Text Markup Language that is used to make hypermedia and hypertext documents for the Web. More HTML and CSS: Most Popular Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

Add comments to "Using Teletype"

Only registered users can write comment

No comments yet...