HTML Structure

7
Mr. Coder | 16-Sep-2024
Introduction

The <head> tag and <body> tag is a basic need to writing a HTML code.
<head> tag contains all the links and references that to be used in the webpage.
<body> tag contains all the elements of the webpage like <span>, <div>, <input> etc.

Before covering this further please note the there are 2 types of tags

  1. Paired Tags - Have both starting and ending syntax like <head></head>. Here <head> is a starting tag and </head> is an ending tag
  2. Unpaired Tags - Does not have any ending tag this are ended by putting '/' before the last '>', like <input/>.

Format of HTML code

Parent Tag
<html>
</html>

Parent Tag with <head>
<html>
     <head>
     </head>
</html>

Parent tag with both <head> and <body>
<html>
     <head>
     </head>
     <body>
     </body>
</html>

logo
facebook youtube