Backup Copy of A694875 - Adding Text
Created | Updated Sep 24, 2002
Paragraphs
To put text into a paragraph, use this:
<p> stuff stuff stuff stuff stuff </p>You will notice that HTML doesn't indent paragraphs. Sorry1. There are other ways of separating chunks of text.
Line Breaks and Horizontal Rules
<br />This is a "line break". It is one of the few tags in HTML that does not have a partner. It will leave a blank line in your page.
The next one is also a single tag- it is the "horizontal rule":
<hr />...which will look like this:
Emphasis
Sometimes you want to emphasize a particular word or phrase, make it stand out. Here are some common ways to do it:
<b>bold</b><i>italic</i>
<u>underline</u>
Again, you can nest the different tags in almost any combination: bold and italic, bold and underline, italic and underline. Just make sure that the one closest to the text is the first one you turn off, then work your way out. For example:
<b><i><u>This is all three at once!</u></i></b>(You may want to avoid underlining for emphasis: by now, underlined text in a web page is almost universally assumed to be a link.)
Font Size
The next item we'll tackle is font size.2 There are two ways of changing the font size. One is to use headings. This isn't really the best way to do it since, as the name implies, heading tags are intended for the headings, subheadings, titles, subtitles, etc within a page. Not only does the size change but they are automatically bold and a line break is put after it. Try copying and pasting this sample HTML code to get an idea of what the different sizes are.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Headings
</title>
</head>
<body>
<h1> biggest </h1>
<h2> big </h2>
<h3> normal </h3>
<h4> smallish </h4>
<h5> tiny </h5>
<h6> eek! </h6>
</body>
</html>
The other way of changing the font size is through the FONT tag. The size can be set from 7 to 1. (For whatever reason, the numbers are in reverse order for the FONT tag then they are for the heading tag: 7 is largest, and 1 is smallest.)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Font Sizes
</title>
</head>
<body>
<font size="7"> huge </font>
<font size="6"> big </font>
<font size="5"> largish </font>
<font size="4"> about normal </font>
<font size="3"> small </font>
<font size="2"> tiny </font>
<font size="1"> helllooo out there </font>
</body>
</html>
Setting the font for your page
Another way to liven up your text is to change the font. To set the default font for your page, put this tag just after the "<body>" tag
<font face="tahoma, verdana, arial">Remember to put a "</font>" tag just before the "</body>" tag.
It is best to put at least two, if not three possible fonts in your default setting. The browser will try the first one, and if it isn't available will go to the second, then the third, and if all else fails it will resort to its own default font. If you really must have an exotic font, be careful- you may severely restrict who can view your sight if very view people have that font. As a rule of thumb, the more common fonts that are widely accepted are Times, Helvetica, Arial, and Tahoma.
Try seeing what results the following HTML code produces:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Testing Headings
</title>
</head>
<body>
<font face="tahoma" size="7"> huge </font>
<font face="arial" size="6"> big </font>
<font face="verdana" size="5"> largish </font>
<font face="courier" size="4"> about normal </font>
<font face="times new roman" size="3"> small </font>
<font face="system" size="2"> tiny </font>
<font face="small fonts" size="1"> helllooo out there </font>
</body>
</html>
With this, you can do a plain text page. Not very exciting yet, but you have to start somewhere, right?