LERAN HTML COMPLETE

Learn one of the most powerful programming languages in the world and become a rockstar developer.

HTML Meta


The HTML <meta> Element

The <meta> element is used to specify which character set is used, page description, keywords, author, and other metadata.

Metadata is used by browsers (how to display content), by search engines (keywords), and other web services.

Define the character set used:

Example

<meta charset="UTF-8">

Define a description of your web page:

Example

<meta name="description" content="Free Web tutorials">

Define keywords for search engines:

Example

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

Define the author of a page:

Example

<meta name="author" content="John Doe">

Refresh document every 30 seconds:

Example

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

Example of <meta> tags:

Example

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

Setting The Viewport

HTML5 introduced a method to let web designers take control over the viewport, through the <meta> tag.

The viewport is the user's visible area of a web page. It varies with the device, and will be smaller on a mobile phone than on a computer screen.

You should include the following <meta> viewport element in all your web pages:

Example

<meta name="viewport" content="width=device-width, initial-scale=1.0">
Tips: If you are browsing this page with a phone or a tablet, you can click on the two links below to see the difference.


x
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Privacy Policy That's Fine