Text Formatting
In HTML the transition to a new row is maked by introducing <br> label (short for row breaks - broken line) and for new paragraph the label <p> (short for Paragraph).
<hr> label (short for horizontal rule - a horizontal rule) introduces a horizontal line and moving to a new row.
Using the appropriate labels the text can be formatted.
For example, they can change for font: size, color, shape (normal, bold, italic), family (Arial,Verdana, etc.), the text can be aligned horizontally or vertically and titles (header), from 1-6, are different in size (the largest one and 6 the lowest).
Labels <div> and </ div> delimit a block (a generic container) for formatting. One is the align attribute of div block which can take values:
- center - to center alignment
- left - Align Left
- right - align right
- justify - alignment justified at both ends of the page
In a situation where we want the text introduced to be displayed exactly as it has been introduced (preformatated text) in the file source we will use the pair of labels <pre> and </pre> (took the preformatted text).
Example:
| HTML Code: | What is displayed in the browser: |
| Normal text | Normal text |
| <b>text bold</b> | text bold |
| <i>text cursive (italic)</i> | text cursive (italic) |
| <u>text (underline)</u> | text (underline) |
| <del>deleted text</del> | |
| <sup>exponent (superscript)</sup> | exponent (superscript) |
| <sub>indice (subscript)</sub> | indice (subscript) |
| <tt>monospatiate characters (teletype)</tt> | monospatiate characters (teletype) |
| <cite>quote (cite)</cite> | quote (cite) |
| <em>revealed (emphasis)</em> | revealed (emphasis) |
| <code>computer code</code> | computer code |
| <kbd>keyboard</kbd> | keyboard |
| <samp>sample</samp> | sample |
| <strong>Tickened text (strong)</strong> | Tickened text (strong) |
| <big>big text</big> | big text |
| <small>small text</small> | small text |
| <font color="red">red font </font> | red font |
| <font face="Courier">font Courier</font> | font Courier |
| <font size="6">font size=6 </font> | font size=6 |
| <div align="center">text aligned center</div> | text aligned center |
| <div align="left">text aligned left</div> | text aligned left |
| <div align="right">text aligned right</div> | text aligned right |
| <h1>Title 1 </h1> | Title 1 |
| <h2>Title 2</h2> | Title 2 |
| <h3>Title 3</h3> | Title 3 |
| <h4>Title 4</h4> | Title 4 |
| <h5>Title 5</h5> | Title 5 |
| <h6>Title 6</h6> | Title 6 |
| There are no comments on this article. Be the first to say your opinion. |






