HTML meta element

HTML <meta> element

  • The meta tag describes some basic metadata.
  • The <meta> tag provides metadata. Metadata is not displayed on the page, but is parsed by the browser.
  • META elements are typically used to specify the description of a web page, keywords, last modified time of the file, author, and other metadata.
  • Metadata can be used in browsers (how to display content or reload pages), search engines (keywords), or other web services.
  • <meta> is usually placed in the <head> area

For Chinese web pages, you need to use <meta charset="utf-8"> declaration encoding, otherwise garbled characters will appear. Some browsers (such as 360 browsers) set GBK as the default encoding, so you need to set it to <meta charset="gbk">.

Use case

Define keywords for search engines:

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

Define a description for the page:

<meta name="description" content="xxx">

Define Web page author:

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

Refresh the current page every 30 seconds:

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