Home > Web Front-end > HTML Tutorial > Introduction to html head tag (webpage head tag) elements and complete usage examples

Introduction to html head tag (webpage head tag) elements and complete usage examples

寻∝梦
Release: 2018-08-25 10:15:57
Original
7120 people have browsed it

This article introduces the various components of the html head, including some common tags used in the head in html. Later, it demonstrates the use of these tags to netizens on the PHP Chinese website through examples, and has a complete case display. The header code of a web page.

html The definition and usage of the head tag:

tag is used to define the head of the document, which is a container for all head elements. Elements within can reference scripts, instruct the browser where to find style sheets, provide meta information, and more.

The header of the document describes various attributes and information of the document, including the title of the document, its location on the Web, and its relationship with other documents. The data contained in the header of most documents will not actually be displayed to readers as content.

The following tags can be used in the head section: , , ,

.

html Examples of using the head tag:

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>认识head标签</title>
    </head>
    <body>
        <h1>欢迎来到PHP中文网</h1>
    </body>
</html>
Copy after login

The header of the document describes various attributes and information of the document, including the title of the document, etc. The data contained in the header of most documents will not actually be displayed to readers as content.

tag: The text content between the <title> and tags is the title information of the web page, which will appear in the title bar of the browser. The title tag of a web page is used to tell users and search engines what the main content of the web page is. Search engines can quickly determine the theme of the web page through the title of the web page. The content of each web page is different, and each web page should have a unique title.

html Example of the title tag in the head tag:

<head>
    <title>hello world</title>
</head>
Copy after login

html Elements contained in the head tag:

title , base, link, meta, script, style and other common tags.

html Explanation of elements contained in the head tag:

  • title is the only title tag of the web page -title tag

  • base is the default opening method of the web page. The declaration tag base

  • link is a link tag, including external css file references, js file references, favicon.ico icon references, etc. Link introduction

  • meta includes a wide range of content tags, such as web page keywords, web page introduction, author, web page encoding, robots, automatic jump and other declaration and description tags. Meta introduction

  • script is to introduce external js files to directly embed the js or css file tags of the web page in

  • style.

Browser support

All browsers support the tag.

【Editor's related recommendations】

What is the color attribute of the HTML font tag? Introduction to the usage of fontcolor (with color code table)

html5 What is the role of the details tag?

Introduction to the use of tags (with usage examples)

The above is the detailed content of Introduction to html head tag (webpage head tag) elements and complete usage examples. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template