How HTML text labels are used

Source: Internet
Author: User

1.<pre></pre>

2.

3.<b></b><i></i><u></u>

4.<tt></tt><cite></cite><em></em><strong></strong>

5.<font></font>

In the previous tutorial we talked about how to output text in a browser, and the format of text output, in this tutorial we will talk about text output fonts such as italic, bold, underline, and so on. A comprehensive example of a text label is given at the end of this tutorial, and the reader is expected to read it carefully.

1.<pre></pre>

<pre></pre> label pairs are used to preprocess text.

2.

The HTML language provides a series of label pairs that manipulate the caption in the text:

3.<b></b><i></i><u></u>

People who use WORD very often have a good grasp of these three pairs of labels. <b></b> used to make text output in bold form; <i></i> used to make text output in italic form;<u></u> used to make text underlined below. There will be a comprehensive example, so this is no longer explained in detail here.

4.<tt></tt><cite></cite><em></em><strong></strong>

These tags are used just as they are above, except that the text is printed in a different font. <tt></tt> text used to output a typewriter-style font;<cite></cite> a font used to output references, usually italic;<em></em> Used to output text that needs to be emphasized (usually italic and bold);<strong></strong> is used to output heavier text (usually italic plus bold). Examples of these pairs of labels will also appear in the examples in the following synthesis.

5.<font></font>

<font></font> is a useful label pair that can change the font size and color of the output text randomly, mainly through the control of its two properties size and color. The Size property is used to resize the font, which can take values:-1, 1, and +1, while the color property is used to change the colour of the text, which is the hexadecimal RGB color code or the color constant name given in the HTML language that we talked about in tutorial one. For specific use, please see the example below.

Example 4 A comprehensive sample of text labels

A comprehensive example of <title> text labels </title>

<body text= "Blue" >

<p><b> Bold character Text </b> </p>

<p><i> Italic text </i> </p>

<p><u> add an underlined text </u> </p>

<p><tt> Typewriter Style text </tt></p>

<p><cite> Text </cite></p> Reference mode

<p><em> emphasis on text </em></p>

<p><strong> aggravated text </strong></p>

Text </font></p> <p><font size= "+1" color= "Red" >size value "+1", Color value "red"

</body>

The results shown in this example in the browser are as follows:

The largest title

Use the title of H3

The largest title

Bold character text

Italic text

Add underlined text

Typewriter-style text

Text of the Reference method

underlined text

Aggravated text

Text with size value "+1" and Color "red"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.