
|
 |
 |

Entering a new line in your code by pressing "Enter" will not produce a new line when viewed in your web browser. When the browser renders your code it attaches each line together, and disregards any extra spaces. This section will help you in creating the formatting necessary to layout your text.
Pre
There is one tag that allows you to have your text preformatted and therefore rendered just as you have entered it in your text editor. The <PRE> </PRE> tag retains all of the tabs, returns, and white spacing that you have within this tag. Preformatted text will appear in your browser as mono-spaced text (fixed-width font). So unless you want all your text mono-spaced you will need to learn the following HTML tags for formatting. Preformatted text is best used when displaying code, ASCII art, or where the font can be mono-spaced and the line spacing and returns are essential.
Note: Preformatted text won't read your text editor's word wrapped returns; you must enter a return where you will want it to show up.
P
The <P> </P> tag is used to begin a new paragraph. It inserts a new line before the block of text. The <P> tag has an optional ending tag, which means that it is not necessary, it is implied and the browser will still render it with no errors. I recommend using ending tags even when they are optional this will help you get used to XHMTL in which all tags have an ending tag.
Align
The align attribute allows you to align a block of text either left, center, right, or justify. Most browsers support this attribute but you should always test it. If this attribute is omitted the default alignment will be to the left.
Br
The line break tag basically acts just like the "Enter" button on a text editor, it breaks the line your on and starts you at the beginning of the next one. The <BR> tag has no closing tag it is an empty tag. I prefer to use two <BR> tags in place of a <P> tag when you want that extra line space in-between paragraphs, and I think it is pretty common practice among developers also. I think it had something to do with the rendering of the <P> tag on a Mac browser but I can't remember exactly which one or what version.
© Copyright 2000-2002 by Pepmint.com. All Rights Reserved |
 |
 |
|