Basic concepts of head related labels

1 Head related labels

1.1 title tag

The title tag is used to define the title of the HTML page. It is a double tag, and the content between the opening and closing tags is the page title to be set.
Its role is:

  • Display the title in the title bar of the browser
  • The title can be used as the name of the default shortcut or favorite
  • The title can also be used as the page title in search engine results

Note when applying:

  • A webpage can only have one title
  • The length of the title name does not exceed 64 characters
  • No other tags are allowed between the title tag pair

1.2 meta tags

The meta tag is a single tag that defines the meta information of the page. Meta information is not displayed in the browser window, but it is readable by the machine. In the HTML page, you can add multiple meta tags.
Its role is:

  • Set the properties of the page, such as refresh, expiration, cache, cookie, etc.
  • Set the properties of the search engine, such as setting keywords, introduction, author, robot guide, copyright, editor, etc.
  • Set the character encoding attributes.
    <meta/>The syntax format of the label:
<meta http-equiv="" content="" charset=""/>
<meta name="" content="" charset=""/>     

Format description:

  • http-equiv sets the attributes of the page, and its related content is described by the value of the content attribute
  • The name sets the attributes of the search engine, and its related content is also described by the value of the content attribute
  • charset is a new attribute of HTML5, used to set the character encoding type.

1.3 link tag

The link tag can refer to external files. It is a single tag, a page allows multiple link tags to reference multiple external files.
Its role is:

  • Specify the address of an external document
  • Specify the relationship between the current document and the referenced external document
  • Explain
    <link/>the grammatical format of the type tag that references external documents :
<link href="" rel="" type=""/>

Format description:

  • href sets the address of an external document
  • rel sets the relationship between the current document and the referenced external document
  • type sets the type of external document.

1.4 style tag

The style tag is used to define styles for HTML documents. It is a double tag, and there are CSS style rules between the opening and closing tags. Each HTML document can contain multiple style tags.

Pay special attention : the type attribute in the style tag must be set, and the attribute value can only be "text/css".

2 Related multiple-choice questions and reference answers

2.1 Multiple choice questions

1. In HTML, the title of the page should be placed in ()

A,
between tags
B,
between tags
C,
anywhere in HTML

2. Regarding the usage of the title tag, which statement is correct ().

A. A
page can use the title tag multiple times to set the title

B.
Other tags can be nested in the title tag

C. The
title set by the title tag can be used as the name of the default shortcut or favorite

3. If you set meta information such as page refresh and expiration date, you can add the corresponding name attribute to the meta tag.

A.
Correct

B.
Error

4. Among the following link tag attributes, () can be used to specify the relationship between the current document and the referenced external document.

A、
href

B、
rel

C、
type

5. The type attribute in the style tag has multiple values.

A.
Correct

B.
Error

2.2 Reference answer

1、C
2、C
3、B
4、B
5、B

Guess you like

Origin blog.csdn.net/TNANDXYF/article/details/113106732