HTML <head>

View online examples

<title> - defines the title of the HTML document
using the <title> tag defines an HTML document title

<base> - defines all linked URL
using the <base> define the default page all the links of the link target address.

<meta> - provides the meta tag in the HTML document
using the <meta> element to describe the HTML document description, keywords, author, character set and so on.


HTML <head> element

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

May be added in the head region of the element tag is: <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 the title of the browser toolbar
  • When the page is added to the favorites, displayed in the title favorites
  • Title that appears in the search engine results page

A simple HTML document:

Examples

<!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 all links tags:

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

HTML <link> element

<Link> tag defines the relationship between documents and external resources.

<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 can also directly add style to render an 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 parsed by the browser.

Last modified META elements are typically used to specify page description, keywords, file, 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> General placed in <head> region

<Meta> tag - Example

Defined keywords for search engines:

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

Definition describes the contents of a Web page:

<Meta name = "the Description" Content = "Free Web & Programming Guide" >  

Define Web page author:

<meta name="author" content="Runoob">

Refresh the current page every 30 seconds:

<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 later sections.


HTML head element

label description
<head> 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 an external resource
<meta> It defines the metadata in HTML documents
<script> It defines the client-side scripting files
<style> Style file defines the HTML document

Guess you like

Origin www.cnblogs.com/fewfwf/p/11802735.html