Questions And Answers

More Tutorials


The HTML <head> element is a container for the following elements:

<title> , <style> , <meta> , <link> , <script> , and <base>.

HTML <head> element

The <head> element is placed between the <html> tag and the <body> tag.

Html head




HTML <title> element

The <title> element defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.

Html title

        <title> document </title>
    The content of the website here...

HTML <style> element

The <style> element is used to define style information for a single HTML page:

Html style

   body { background-color: white; } 
   a { color: blue; } 
   div { margin: 10px; } 

HTML <link> element

The <link> element defines the relationship between the current document and an external resource.

Html link

<link rel="stylesheet" href="style.css">

HTML <meta> element

The <meta> element is typically used to specify the character set, page description, keywords, author of the document, and viewport settings.

The metadata will not be displayed on the page, but are used by browsers (how to display content or reload page), by search engines (keywords), and other web services.

The character set

<meta charset="UTF-8">

The keywords for search engines

<meta name="keywords" content="HTML, CSS, Javascript">

The description of your web page

<meta name="description" content="HTML documentation">

The author of page

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

Refresh document every 30 seconds

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

Setting the viewport to make your website look good on all device

<meta name="viewport" content="width=device-width, initial-scale=1.0">

HTML <script> element

The <script> element is used to define client-side JavaScripts.

Html style

   function myFunction(){
       document.getElementById("demo").innerHTML = "Hello Javascript!";

HTML <base> element

The <base> element specifies the base URL and/or target for all relative URLs in a page.
There can only be one single <base> element in a document!

Html style

   < base href"" target_blank >


In this page (written and validated by ) you learned about HTML Head . What's Next? If you are interested in completing HTML tutorial, your next topic will be learning about: HTML computer code.

Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue:

Share On:

Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using, you agree to have read and accepted our terms of use, cookies and privacy policy.