HTML learning (9) of the head

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

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="//www.baidu.com/images/" target="_blank">

</head>

<body>

<Img src = "xxx.png"> here just write the name of the picture, but because the definition of the base label, so this picture will be displayed www.baidu.com/images/xxx.png

<a href="//www.baidu.com"> Baidu </a> There is no definition of target properties, but because the definition of the base label, it will open the URL in a new window

</body>

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">

Guess you like

Origin www.cnblogs.com/1016391912pm/p/11528652.html