HTML- head

HTML <head> element

<Head> element is a container for all the head elements. Elements within the <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and so on.

Tags can be added to the head portion: <title>, <base>, <link>, <meta>, <script> and <style>.

HTML <title> element

<Title> tag defines the title of the document.

the title element in all HTML / XHTML documents are required.

title elements can:

  • Defines the title of the browser toolbar
  • Provide a page is added to the title that appears when favorites
  • Displays the page title in search engine results

A simplified HTML document:

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>

HTML <base> element

<Base> tag all links on the page specified default address or a default target (target):

<head>
<base href="http://www.w3school.com.cn/images/" />
<base target="_blank" />
</head>

HTML <link> element

Tag defines the relationship between a document and an external resource <link>.

<Link> tag connections most commonly used stylesheet:

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
HTML <style>

<Style> tag is used to define style information for HTML documents.

You can specify the style HTML elements rendered in a browser within a style element:

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

HTML <meta> element

Metadata (metadata) is information about data.

<Meta> tag provides metadata about the HTML document. Metadata is not displayed on the page, but for a machine-readable.

Typically, meta element is used to describe the provisions of the page, keyword, author of the document, last modified, and other metadata.

<Meta> tag is always in the head element.

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

Keywords for search engines

Some search engines will use the name and content attributes of the meta element to index your page.

The following meta element defines a description of the page:

<meta name="description" content="Free Web tutorials on HTML, CSS, XML" />

The following meta element defines a page Keywords:

<meta name="keywords" content="HTML, CSS, XML" />

Role name and content attributes is to describe the content of the page.

HTML <script> element

<Script> tag is used to define client-side script, such as JavaScript.

We will explain the script element in a later section.

HTML header element

label description
<head> Definition information about the document.
<title> Defines the document title.
<base> All default address or a default target link on custom page.
<link> Define relationships between documents and external resources.
<meta> Define metadata about the HTML document.
<script> Define client-side script.
<style> Style information defined in the document.

Guess you like

Origin www.cnblogs.com/fighter007/p/11351717.html