Occasionally, you will want to allow a browser to hyphenate long words to better justify a paragraph. For example, consider the following code and its resulting output.
<p style="text-align: justify;"> The morbid fear of the number 13, or triskaidekaphobia, has plagued some important historic figures like Mahamiya and Nanao.</p>
In cases where you want a client browser to be able to hyphenate a word if necessary, use the soft hyphen entity (­) to specify where a word should be hyphenated. So above example should be written as follows:
NOTE: This may notwork with some web browsers.<p style="text-align: justify;"> Example for soft hyphen - The morbid fear of the number 13, or tri­skai­deka­phobia, has plagued some important historic figures like Mahamiya and Nanao.</p>
Preserve Formatting - The <pre> Element:
Sometimes you want your text to follow the exact format of how it is written in the HTML document. In those cases, you can use the preformatted tag (<pre>).Any text between the opening <pre> tag and the closing </pre> tag will preserve the formatting of the source document.
<pre>
function demoFunction( strText ){
alert (strText) }
</pre>
Horizontal Rules - The <hr /> Element:
Horizontal rules are used to visually break up sections of a document. The <hr> tag creates a line from the current position in the document to the right margin and breaks the line accordingly.
For example you may want to give a line between two paragraphs as follows:
<p>This is paragraph one and should be on top</p><hr /><p>This is paragraph two and should be at bottom</p>
Again <hr /> tag is an example of an empty element, where you do not need opening and closing tags, as there is nothing to go in between them.
Note: The <hr /> element has a space between the characters br and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <hr> it is not valid XHTML
Presentational Tags:
If you use a word processor, you are familiar with the ability to make text bold, italicized, or underlined; these are just three of the ten options available to indicate how text can appear in HTML and XHTML.
Bold Text - The <b> Element:
Anything that appears in a <b>...</b> element is displayed in bold, like the word bold here:
<p>The following word uses a <b>bold</b> typeface.</p>
Italic Text - The <i> Element:
Anything that appears in a <i>...</i> element is displayed in italicized, like the word italicized here:<p>The following word uses a <i>italicized</i> typeface.</p>