HTML text formatting instance,
1. Text Formatting: This example shows how to format text in an HTML file.
The effect is as follows:
Ii. pre-formatted text: This example shows how to use the pre label to control empty rows and spaces.
<Html> <body> <pre> This is pre-formatted text. It retains spaces and line breaks. </Pre> <p> pre labels are suitable for displaying computer code: </p> <pre> for I = 1 to 10 print inext I </pre> </body>
The effect is as follows:
3. "computer output" label: This example shows the Display Effect of Different "computer output" labels.
<Html> <body> <code> Computer code </code> <br/> <kbd> Keyboard input </kbd> <br/> <tt> Teletype text </tt> <br/> <samp> Sample text </samp> <br/> <var> Computer variable </var> <br/> <p> <B> note: </B> these labels are often used to display computer/programming code. </P> </body>
The effect is as follows:
4. Address: This example shows how to write an address in an HTML file.
<!DOCTYPE html>
The effect is as follows:
5. Abbreviations and acronyms: This example shows how to implement abbreviations or acronyms.
<Html> <body> <abbr title = "etcetera"> etc. </abbr> <br/> <acronym title = "World Wide Web"> WWW </acronym> <p> in Some browsers, when you move the mouse over the acronyms, the title can be used to display the complete expression version. </P> <p> only valid for acronym elements in IE 5. </P> <p> it is valid for both the abbr and acronym elements in Netscape 6.2. </P> </body>
The effect is as follows:
6. Text direction: This example shows how to change the text direction.
<Html> <body> <p> If your browser supports bi-directional override (bdo), the next line is output from right to left (rtl ); </p> <bdo dir = "rtl"> Here is some Hebrew text </bdo> </body>
The effect is as follows:
7. Block reference: This example shows how to implement a quote with different lengths.
<Html> <body> This is a long reference: <blockquote> This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. This is a long reference. </Blockquote> This is a short reference: <q> This is a short reference. </Q> <p> when the blockquote element is used, the browser inserts line breaks and margins, while the q element does not have any special rendering. </P> </body>
The effect is as follows:
8. Delete sub-effects and insert sub-effects.
<Html> <body> <p> A dozen of <del> 20 </del> <ins> 12 </ins> pieces. </P> <p> most browsers rewrite to delete text and underline text. </P> <p> some older browsers display the deleted text and underline text as plain text. </P> </body>
The effect is as follows: