HTML uses tags to alter how things are displayed on a page. A tag is a command written withing angled brackets and placed around an element (picture, text, or other object). There are two tags around each element, an opening tag:
<command>and a closing tag
</command>They combine to look like this:
<command>Your text or picture here</command>Tags can be combined and nested. For example, the <big> command makes a font increase in size. Using nested <big> tags can make a string of text continually increase in size.
Examine the following code:
<big>Some text, <big>some more text, <big>and some more.</big></big></big>The <big> tag is used three times, each successive tag nested inside the one before it, making the font size grow more and more. The resulting HTML page will display like this:
Tags can also have attributes. An attribute is a value that changes the way a tag works. For example, the <font> tag is used to adjust the font of some text. To change the color of that font, we use the color attribute.
<font color="red">red</font>It displays like this:
There are many tags that affect the look of text on your page. Here are some of the most common ones.
| Tag | Used for | Example | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<strong> |
For making text boldface | This text is bold | ||||||||||||||||
<em> |
For making text italicized | This text is italicized | ||||||||||||||||
<big> |
For increasing text size | This text is bigger | ||||||||||||||||
<small> |
For decreasing text size | This text is smaller | ||||||||||||||||
<sup><sub> |
For superscript and subscript text | This text is superscript and this is subscript | ||||||||||||||||
<tt> |
Makes the text fixed-width ("typewriter text") | This text is fixed-width and monospace | ||||||||||||||||
<font color="red"> |
Makes the text red. You can replace red with the appropriate color. Note the space between font and color. |
|
||||||||||||||||
<font face=" "> |
For changing the typeface. Since not all users' computers will have the same fonts installed, we must instead specify a family of fonts.
<font face="Arial, Helvetica, sans-serif">Your text here</font>
|