Latest web development tutorials

HTML head

Examples

See online examples

<title> - defines the title of the HTML document
Use <title> tag defines an HTML document header

<base> - defines all linked URL
Use <base> link to define the default page for all the link target address.

<meta> - Providing the meta tags of an HTML document
Use <meta> element to describe an HTML document description, keyword, author, character set and so on.


HTML <head> element

<Head> element contains all the header label elements. In the <head> element you can insert scripts (scripts), style file (CSS), and a variety of meta information.

You can add in the head region of the element tag: <title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>.


HTML <title> element

<Title> tag defines the title of different documents.

<Title> in HTML / XHTML document is a must.

<Title> element:

  • It defines a title browser toolbar
  • When added to the Favorites page, display the title in the favorites list
  • Display the title in the search engine results page

A simple HTML document:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>文档标题</title>
</head>

<body>
文档内容......
</body>

</html>


HTML <base> element

<Base> tag describes the basic link address / link target, the label as the default link HTML document tag all links:

<Head>
<Base href = "http://www.w3big.com/images/" target = "_ blank">
</ Head>


HTML <link> element

<Link> tag defines the relationship between a document and an external resource.

<Link> tag is generally used to link to the style sheet:

<Head>
<Link rel = "stylesheet" type = "text / css" href = "mystyle.css">
</ Head>


HTML <style> element

<Style> tag defines the style file HTML documents referenced address.

In the <style> element you need to specify the style file to render HTML document:

<Head>
<Style type = "text / css">
body {background-color: yellow}
p {color: blue}
</ Style>
</ Head>


HTML <meta> element

meta tag describes some basic metadata.

<Meta> tag provides metadata. Metadata is not displayed on the page, but will be resolved browser.

Last modified META elements are typically used to specify page description, keywords, files, author, and other metadata.

Metadata can be used in browsers (how to display content or reload page), search engines (keywords), or other Web services.

<Meta> are generally placed in the <head> area

<Meta> tag - Use Case

Defined keywords for search engines:

<Meta name = "keywords" content = "HTML, CSS, XML, XHTML, JavaScript">

Definition describes the page content:

<Meta name = "description" content = "Free Web tutorials on HTML and CSS">

On the custom page:

<Meta name = "author" content = "Hege Refsnes">

Every 30 seconds to refresh the current page:

<Meta http-equiv = "refresh" content = "30">


HTML <script> element

<Script> tag is used to load a script file, such as: JavaScript.

<Script> element will be described in detail in the following sections.


HTML head element

label description
<head> It defines the information document
<title> It defines the title of the document
<base> Defines the default page links link address labels
<link> It defines the relationship between a document and external resources between
<meta> It defines the HTML document metadata
<script> It defines the client script files
<style> Style file defines the HTML document