HTML Header

HTML <head> element

The <head> element contains all the head tag elements. In the <head> element you can insert scripts (scripts), style files (CSS), and various meta information.

Element tags that can be added in the header area are: <title>, <style>, <meta>, <link>, <script>, <noscript> and <base>.

HTML <title> element

The <title> tag defines the title of the various documents.

<title> is required in HTML/XHTML documents.

<title> element:

  • Defines the title of the browser toolbar
  • The title displayed in the favorites when the page is added to the favorites
  • The title displayed on the search engine results page

A simple HTML document:

< ! DOCTYPE html >
 < html > < head > 
< meta charset = " utf-8 " > 
< title > document title </ title > 
</ head > 
< body > 
document content...
 </ body > 
< / html > 

HTML <base> element

The <base> tag describes the base link address/link target, which serves as the default link for all link tags in the HTML document:

<base href="" target="_blank">
<base href = "" target = "_blank" >  

The <link> tag defines the relationship between the document and external resources.

<link> tags are often used to link to style sheets:

<link rel="stylesheet" type="text/css" href="mystyle.css"><link rel = "stylesheet" type = "text/css" href = "mystyle.css" >   

HTML <style> element

The <style> tag defines the style file reference address of the HTML document.

In the <style> element you can also add styles directly to render HTML documents:

<style type="text/css"><style type = "text/css" > 
body {background-color:yellow}{ background - color : yellow }
p{color:blue}{ color : blue }

HTML <meta> element

The meta tag describes some basic metadata.

The <meta> tag provides metadata. Metadata is also not displayed on the page, but is parsed by the browser.

The META element is often used to specify the description of the web page, keywords, the last modification time of the file, the author, and other metadata.

Metadata can be used by browsers (how to display content or reload pages), search engines (keywords), or other web services.

<meta> is usually placed in the <head> area

<meta> tag – usage example

Define keywords for search engines:

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

Define description content for web pages:

<meta name = "description" content = "Free Web & Programming Tutorials" >  

Define page author:

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

Refresh the current page every 30 seconds:

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

HTML <script> element

The <script> tag is used to load script files such as: JavaScript.

The <script> element is described in detail in a later chapter.

HTML head element

<head>defines the information of the document
<title>defines the title of the document
<base>Defines the default link address of the page link label
<link>Defines the relationship between a document and external resources
<meta>Defines metadata in HTML documents
<script>Script file that defines the client
<style>A style file that defines the HTML document