leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

HTML Header

Estimated reading: 4 minutes 35 views

<title> – defines the title of the HTML document
Use the <title> tag to define the title of the HTML document

<base> – defines the URL of all links
Use <base> to define the default link destination for all links in the page.

<meta> – Provides meta tags for HTML documents.
Use the <meta> element to describe the description, keywords, author, character set, etc. of HTML documents.


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:

example

<!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:

<head>
    <base href="https://www.coding180.com/images/" target="_blank">
    <base href="https://www.coding180.com/images/" target="_blank">
</head>

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

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

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

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:

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

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

Define page author:

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

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

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

Leave a Comment

CONTENTS