Syntax

HTML Tag

<HTML> is a starting tag.
To delimit the text inside, add a closing tag by adding a forward slash “/” to the starting tag.

Most but not all tags have a closing tag.
It is necessary to write the code for an HTML page between <HTML> and </HTML>.
This <HTML> tells the browser is 'this is the start of an HTML document' and </HTML> 'this is the end of an HTML document'.

<html>
……………………..
………………………
………………………….
</html>

Head Tag

  • Before the < body > element you will often see a <head> element.
  • This contains information about the page, rather than information that is shown within the main part of the browser.
  • You will usually find a <title> element inside the <head> element.
  • <head> is opening head tag and </head> is closing head tag.

<html>
<head>
<title> Hello </title>
</head>
</html>

Title Tag

  • The contents of the <title> element are either shown in the top of the browser, above where you usually type in the URL of the page you want to visit, or on the tab for that page (if your browser uses tabs to allow you to view multiple pages at the same time). <title> is opening title tag and </title> closing title tag.

<html>
<head>
<title> Hello </title>
</head>
</html>

Body Tag

  • Everything inside this element is shown inside the main browser window. <body> is opening body tag and </body> is closing tag.

<html>
<head>
<title> Hello </title>
</head>
<body>
<h1> Body of Page </h2>
</body>
</html>

Type of Tag

  • Container Tag – Which has opening and closing Tag.
  • Ex: -
    <html> ……. </html>
    <head> ……. </head>
    <body> ……. </body>

  • Empty Tag – which has only opening tag.
  • Ex: -
    <br>
    <area>
    <base>
    <hr>
    <img>
    <input>

Element

  • The combination of a start and end tags define an element.
  • Everything between the two tags is referred to as the contents of the element.
  • <h1> A heading </h1>
Cristle Academy

Compiler