Text >> Formatting
|
|
Text
To enter text on your pages - all you have to do is simply enter the text.
If you do not specify any attributes for text it will use the default size, font etc. of the visitor's browser.
Browsers can only show fonts available on the visitor's PC.
Therefore you are limited to using the fonts that are available on almost any computer.
If you need to use a fancy font, you should use your graphics program to make an image with the text. This will assure that the visitor will see it - even if he doesn't have the fancy font you're using.
Since images take up much more space than plain text, thus increasing download time, you should use this option with care.
On the following pages you will learn how to customize the font settings - both on normal text and text that works as a link.
Furthermore, you will learn to control how the text aligns on your pages.
Base Font
To specify the overall font for your page add the tag at the beginning of the section.
Hello! This is my page.
All text looks the same
since I only specified a basefont.
Example: The page as it looks in the browser.
<html>
<head>
<title>my page</title>
</head>
<body>
<basefont face="arial, verdana, courier" size="2" color="green">
Hello! This is my page.<br>
All text looks the same<br>
since I only specified a basefont.<br>
</body>
</html>
The color attribute selects the desired color for your text. The face attribute selects the desired font.
Note:
If you enter a list of fonts, like in the example, the browser will use the first font in the list available on the visitor's computer.
The size attribute specifies the desired size, between 1 (smallest) and 7 (biggest).
Font Tag
The <font> tag will change the font.
Example: How the output looks in the browser.
Hello! This is my page.
This local text looks different.
This text looks like the first line.
HTML: The code to produce the above example.
<html>
<head>
<title>My Page</title>
</head>
<body>
<basefont color="green" face="arial" size="2">
Hello! This is my page.<br><br>
<font color="red" face="arial" size="1">
This local text looks different.
</font>
<br><br>
This text looks like the first line.
</body>
</html>
The color attribute selects the desired color for your text. The face attribute selects the desired font.
Note:
If you enter a list of fonts, like in the example, the browser will use the first font in the list available on the visitor's computer.
Text Format
These are the tags for text formats:
| <b>
| writes text as bold
| <b>sample text</b>
|
| <i>
| writes text in italics
| <i>sample text</i>
|
| <u>
| lowers text and makes it smaller
| <u>sample text</u>
|
| <sub>
| lifts text and makes it smaller
| <sub>sample text</sub>
|
| <sup>
| writes text as bold
| <b>sample text</b>
|
| <strike>
| strikes a line through the text
| <strike>sample text</strike>
|
| <tt>
| writes text as on a classic typewriter
| <tt>sample text</tt>
|
| <pre>
| writes text exactly as it is, including spaces.
| <pre>sample text </pre>
|
| <em>
| usually makes text italic
| <em>sample text</em>
|
| <strong>
| usually makes text bold
| <strong>sample text</strong>
|
|
|
|
|