1.3.2 HTML basic tag-set text format

Source: Internet
Author: User

2. Set text format
Text is an important part of HTML web pages. When writing HTML documents, you can place the text between tags to set the text format. Set the text format in the document to segment and line feed, set the paragraph alignment, set the font, font size and text color, and set the character style.

1) segment mark.


A section is the basic unit of information about a document. The original carriage return and line feed are ignored in the document. The segment mark defines a new paragraph, line feed, and insert an empty line.
Use tags separately

A row is left blank, so that the subsequent content is displayed in another row. Use both

And

The section is surrounded to represent a segmented block.
Common attributes are as follows:
Align = horizontal alignment of paragraphs
The value is as follows:
Left: Left alignment, default value)
Center: Center
Right: Right
Justify: aligned on both sides
If this attribute is omitted, the default value is used. The same below.

2) line feed mark
.

The line feed mark forcibly specifies a forward interruption so that subsequent content is displayed in the next line.

3) Title Tag:
...
...
...
...
...
...
The title tag is used to set the title and subtitle in the document. It indicates the title with the largest font and the title with the smallest font.
Common attributes are as follows:
Align = horizontal alignment of paragraphs

4) center mark.

...
All content in the mark center is centered and aligned.

5) block tag ....
Define document blocks. Common attributes are as follows:
Align = horizontal alignment of paragraphs

6) horizontal line mark.
The Hr mark adds a horizontal line to the document to separate the document.
Common attributes are as follows:
Align = horizontal alignment of paragraphs
Color = line Color
NoShade = display a solid line without shadow
Size = line width
Width = the length of the Line pixel or percentage of the page Width percentage ))

7) font mark ....
Font is used to set the character format of text, including the Font, Font size, and color. Common attributes
As follows:
Face = "font names" separated)
The browser first uses the 1st fonts in the font table to display the marked text. If no 1st fonts are installed on the computer where the browser is running, the system will try the 2nd fonts in the font table until the matching fonts are found. If the font cannot be found after the list ends, the browser uses the default font.
Size = "font Size"
The Size attribute specifies the font Size of the font. The value ranges from 1 ~ 7. The default value is 3. The larger the Size value, the larger the font Size. You can also use + or-to specify the relative font size, relative to the basic font BASEFONT.
Color = "Color value"

8) font mark:
...Bold...Italics
...Large font...Small font
...Fixed-width font

9) STYLE tag:
... Superscript... Subscript
...Underline ... Strikethrough
...Strikethrough

10) mark is displayed as is.


Display the content including carriage return and space.
There are often spaces between texts in the Document. When you enter the text, press the Space key multiple times, but only one space can be seen when you open the webpage in a browser. In addition, some special symbols, such as the copyright symbol, may be inserted.©. These symbols cannot be entered directly on the webpage. They can be entered using the character entity name or number representation. For example, to enter a space in a webpage, you can enter "" or. Table 1-2 lists Entity names or numbers with common special symbols.

Symbol entity name numeric representation Symbol entity name numeric representation

No space for broken lines;
The cent sign is invalid;
The pound sign £;
Sign up®®;
Degree °;
2x2;
Cube symbol;

RMB ¥
Festival symbols §§
Copyright symbol©©
"And" Symbol &&
Less than symbol <
Greater than the symbol>
Euro symbol €

Table 1-2 Entity names or numbers with special symbols

If there are many special characters in a section of the document

And
Mark the middle, so that the browser will display the text marked in the middle as is.

Example 1.1: a page with different text display formats and paragraph control, as shown in figure 1-4, contains text display and paragraph control markup.
Source code, for example, ex1-1.htm ):



Level 1 title

This is a black body, the size is 7 characters, red

This is a paragraph
This is ItalicThis is boldThis is an underline font.
This is a big fontThis is a small font
This is subscript font 1 This is superscript font 2

These tags can also be used together


This is another paragraph
The following are escape sequences:
<Less than sign;> greater than sign; &; "Double quotation marks; for example: a> B


The following are some special symbols:
Sign up®
Copyright symbol©
 

Figure 1-4 text display and section control page


BibliographyPrevious sectionNext section

Related Article

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.