Text is the most basic part of Web pages, so I better start with that. You will, of course, want text on your webpage. You'll need to use the basic template for web pages I showed on this page. (This applies for all Web pages)

You have to include specific HTML tags so that your text does not show up as only one line. Simply typing "return" (AKA "enter") when you are typing code will not create a new line.

You'll have to use the <br> tag to start a new line. Or, you can use the <p> tag to create a paragraph. If you use a <p> tag, you won't have to type <br > tags all the time. Also, a <p> tag is more accurate for large amounts of text. A <p> tag does not require a </p> tag. A <br> tag does not require a </br> tag.

You can put in as much text as you want and use as many tags as you want. In fact, there are two more tags you can use, even if you want just plain text.

If you want some text centered, you can use a <center> tag, type the text you want centered and then type a </center> tag. Like any other tag, you can even use more tags between the 2 tags. You can do a similar thing to align text to the right- just use <div align="right" > and </div> tags.

Example:

I like to eat donuts. Donuts are round and are pieces of sweet dough. Donuts are fried in oil and are often topped with things such as sugar, sugar and sugar. The number of possible toppings for a donut is as large as the number depicting the amount of calories they have. Donuts are made in three basic types: with hole, without hole, and donut holes. "With hole" donuts are the most common type. "Without hole" donuts are often filled with jelly and topped with powdered sugar. Donut holes are small spherical donuts.


What the code looks like:

<html><head><title>Donuts</title></head><body>
<center><p>I like to eat donuts. Donuts are round and are pieces of sweet dough. Donuts are fried in oil and are often topped with other things, such as sugar, sugar and sugar. The number of possible toppings for a donut is as large as the number depicting the amount of calories they have. Donuts are made in three basic types: with hole, without hole, and donut holes. "With hole" donuts are the most common type. "Without hole" donuts are often filled with jelly and topped with powdered sugar. Donut holes are small spherical donuts.</center>
<br>
</body></html>
The <center> and </center> tags align the text in the center. The <p> tag turns the text into a paragraph. The <br> tag with nothing next to it creates a blank line. The <div align="right"> and </div> tags put a block of text to the right. You can even combine these tags with other tags that you'll learn later. I explain how to make the text blue <a href="colorguide.html">on this page</a>.
</body></html>

That's all there is to basic text on a webpage. Of course, you combine this with other features. In fact, you can combine any of the features a web page can have.


Go to the next section, formatting.
This page © Alan Gilfoy, 2003-2009.