English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <head> tag

HTML <head> tag contains browser metadata and descriptions that are not directly visible on the web page. This tag is also commonly known as the <head> element.

Online Examples

A HTML document with a <title> tag in the head:

!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<h1>My first web heading</h1>
<p>My first web paragraph.</p>
</body>
</html>
Test to see ‹/›
In this HTML5In the document example, we placed the <meta> tag and the <title> tag inside the <head> tag. You should always see a <title> tag inside the <head> tag.

Browser Compatibility

IEFirefoxOperaChromeSafari

All mainstream browsers support the <head> tag.

Tag Definition and Usage Description

The <head> element is the container for all head elements.

The <head> element must contain the document's title (title), and can include scripts, styles, meta information, and other additional information.

The following elements can be used inside the <head> element:

HTML 4.01 and HTML5between the differences

HTML5 The profile attribute is no longer supported.

Attribute

AttributeValueDescription
profileURLHTML5 Not supported. A series of rules to define the document URL. These rules can be recognized by the browser and accurately read the information in the content attributes of the <meta> tag.

Global Attributes

The <head> tag supports HTML Global Attributes.

Try it yourself - Example

Using the <base> tag in <head>
This example demonstrates how to use the <base> tag to specify the default URL and default target for all links in the page.

Using the <style> tag in <head>
This example demonstrates how to add style information in the <head> section.

Using the <link> tag in <head>
This example demonstrates how to use the <link> tag to link to an external stylesheet.

Related Articles

HTML Tutorial:HTML Header