HTML Introduction | HTML Basic Elements | HTML meta

The <meta> tag element contains property information about the HTML document itself, such as what the document contains, what its keywords are, and who created it.

Specifying <meta>

The <meta> tag is placed in the document header section (<head>~</head>).

<meta name="subject" content="Knowledge sharing across various fields">
<meta name="title" content="Devkuma">
<meta name="author" content="devkuma">
<meta name="keywords" content="meta tag, HTML, knowledge sharing project">

The most commonly used attributes in the <meta> tag are the name and content attributes. Common name attribute values include subject, title, author, and keywords.

Why specify a <meta> element?

The <meta> tag element summarizes the document content and passes information to search engines, and it also passes information to web browsers.

There are two common cases where information is passed to a web browser.

Moving to a specified page

<meta http-equiv="refresh" content="5;url=http://www.devkuma.com/">

This tag is used when a site’s address has changed. It means the browser will move to the page specified by the url attribute value after 5 seconds.

This kind of movement has a different meaning from moving by clicking a hyperlink. Clicking a hyperlink means that the user is reading one page and then moving to another page. Page movement using the <meta> tag means refreshing according to the value specified in the http-equiv attribute.

In other words, a page containing the <meta> tag above is treated as a page that was not viewed.

Passing character set information to the web browser

To tell the web browser that the site is written in Korean, specify the <meta> tag as follows.

<meta http-equiv="content-type" content="text/html; charset=euc-kr">

As shown here, the <meta> tag used to pass information to the web browser uses an attribute called http-equiv.