HTML5 base -4 HTML text

Source: Internet
Author: User

I. Overview of HTML text tags


The role of text markers

(1) text is an important part of the Web page

(2) text written directly will be displayed in the browser's default style

(3) text that is included in the tag is displayed as a style owned by the tag

-Special characters

-Notes

-Title Element

-Paragraph elements

-Wrap Element

-Partition element

- ...


Text with special characters

(1) Space folding

-Multiple spaces or tabs are compressed into a single space, that is, only one space is displayed

(2) Special characters (such as spaces) that need to be escaped (using character entities)

code:<! DOCTYPE html><body> the &lt;p&gt; element.&nbsp;&nbsp;&nbsp;&nbsp;&copy; Jason.</body>

Show Results:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7D/77/wKioL1bpHyLiaFCoAAATCEifwqs813.png "title=" Web.png "alt=" Wkiol1bphyliafcoaaatceifwqs813.png "/>


Ii. Use of text markers


Text Style

(1) The function of text style is to modify the text, such as bold, tilt, etc.

-<b>...</b>: Bold

-<b>...</b>: Tilt

-<b>...</b>: Underline

-<b>...</b>: Strikethrough

-<b>...</b>: superscript

-<b>...</b>: subscript

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7D/77/wKioL1bpH9yiCQ4RAADznAmLL18459.png "title=" Web.png "alt=" Wkiol1bph9yicq4raadznamll18459.png "/>

Title Elements

(1) The title element makes the text appear in an eye-catching way, often used for the title of the article

(2) Basic grammar:

-# = 1,2,3,4,5,6

-From

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7D/78/wKioL1bpIHjQV2hVAAESrsLc5Bs169.png "title=" Web.png "alt=" Wkiol1bpihjqv2hvaaesrslc5bs169.png "/>

Paragraph elements <p>

(1) <p> elements provide a way to structure text

(2) The text in the <p> element is displayed in a separate paragraph

-line breaks apart from the text before and after

-Add an extra vertical gap distance as paragraph spacing

-Common properties: Align

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7D/7A/wKiom1bpIMiC8jxKAAEFci_U85o981.png "title=" Web.png "alt=" Wkiom1bpimic8jxkaaefci_u85o981.png "/>

Line wrapping Elements <br>

(1) Use <br> elements to create a manual wrap anywhere.

-Empty Tag

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7D/7A/wKiom1bpIQfjiZ2GAAEniouLjjA441.png "title=" Web.png "alt=" Wkiom1bpiqfjiz2gaaeniouljja441.png "/>

Partitioning elements <span> and <div>

(1) Partitioning elements are used to group elements, often for page layouts

(2) block partition element:<div></div>

(3) Intra-row partition element:<span></span>

-Set different formats within the same line of text

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/7A/wKiom1bpIaGDOsXsAAFOpRfrqio513.png "title=" Web.png "alt=" Wkiom1bpiagdosxsaafoprfrqio513.png "/>

Inline elements and block-level elements

(1) block-level elements

-By default, block-level elements will have a single line, that is, the element will wrap before and after the elements

-such as: <p>, <div>,

(2) Inline elements

-No line break, can be on the same line as other inline elements

-such as: <span>, <b>, <i>, <u>


Split Line Elements

(1)

-Empty Tag

-often used to separate different parts of a page

-The text behind the

(2) Common Properties

-Size, width, align, color

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7D/78/wKioL1bpIzbzmG1XAADaexxILU8310.png "title=" Web.png "alt=" Wkiol1bpizbzmg1xaadaexxilu8310.png "/>


Pre-formatted <pre>

(1) Preserves formatting in the source document, which preserves the original line breaks and whitespace in the text

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7D/7B/wKiom1bpIv2S1uFwAAEJEp0hXus848.png "title=" Web.png "alt=" Wkiom1bpiv2s1ufwaaejep0hxus848.png "/>


Summary: This chapter focuses on HTML text markup.

This article from the "Technical Exchange" blog, declined reprint!

HTML5 base -4 HTML text

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.