HTML - tags - meta tag

revision:


Content

"meta" tag : defines metadata about an HTML document syntax some examples


"meta" tag : defines metadata about an HTML document

top

The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.
<meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.
Metadata will not be displayed on the page, but is machine parsable. Metadata is used by browsers (how to display content or reload page), search engines (keywords), and other web services. There is a method to let web designers take control over the viewport (the user's visible area of a web page), through the "meta" tag.

Attributes: the <meta> element supports the global attributes and events attributes. Tag-specific attributes include:

charset ; value: character_set;

specifies the character encoding for the HTML document.

content ; value: text;

specifies the value associated with the http-equiv or name attribute.

http-equiv ; value: content-security-policy, content-type, default-style, refresh;

provides an HTTP header for the information/value of the content attribute.

name ; value: application-name, author, description, generator, keywords, viewport;

specifies a name for the metadata;


syntax

top

<meta . . . .>


some examples

top

Codes:

                    <head>
                        <meta charset="UTF-8">
                        <meta name="description" content="Free Web tutorials">
                        <meta name="keywords" content="HTML,CSS,XML,JavaScript">
                        <meta name="author" content="John Doe">
                        <meta name="viewport" content="width=device-width, initial-scale=1.0">
                    </head>
                

Codes:

                    <meta name="viewport" content="width=device-width, initial-scale=1.0">
                    <meta http-equiv="refresh" content="3;url=https://www.mozilla.org">
                    <meta http-equiv="refresh" content="5; url=https://www.javatpoint.com/html-tags-list">
                    <meta name="date" content="2019-08-04" scheme="YYYY-MM-DD">