Page 162 - Webapplication11_C11_Flipbook
P. 162

In  HTML,  elements  are  classified  into  two  main  categories:  container  tags and  empty tags. Understanding the
              difference between these two types of tags is essential for structuring a webpage correctly. The description of these
              tags are as follows:
              Ð ÐContainer tags: A container tag is an HTML element that has both an opening tag and a closing tag, with content
                 placed between them. The content inside these tags can be text, images, or other HTML elements. The closing tag
                 is crucial because it tells the browser where the element ends.
                 Examples:

                 <p> ... </p>
                 <div> ... </div>
                 <h1> ... </h1>
              Ð ÐEmpty Tags: An empty tag, also known as a self-closing tag, is an HTML element that doesn’t contain any content
                 or closing tag. These tags are used for elements that don’t require a closing tag because they don’t enclose any
                 content.

                 Examples:

                 <br>
                 <img>
                 <hr>
              Structure of an HTML Document

              The basic structure of an HTML document is as follows:

               <html>                                             ÐÐÐThe  <html>  tag  is  the  root  element  of  an  HTML
               <head>                                                document.
               <title> My webpage </title>                        ÐÐÐThe <head> tag contains important information about
               </head>                                               the HTML page.
               <body>                                             ÐÐÐThe <title> tag specifies a title for the HTML page which
               Tiger Tiger, burning bright, in the forests of the night.  is shown in the browser’s title bar or in the page’s tab.
               </body>                                            ÐÐÐMain  contents  of  the  document  are  defined  by  the
               <html>                                                <body> element, and contains all the visible contents,
                                                                     such  as  headings,  paragraphs,  images,  hyperlinks,
                                                                     tables, lists, etc.

                 2.4 CREATING AND SAVING AN HTML DOCUMENT

              Let us start  by designing the first web page using the basic tags.
              Step 1:  Open the Notepad and write the following HTML code:

                     <!DOCTYPE html>
                     <html>

                     <head>
                     <title> FIRST WEB PAGE </title>                      1
                     </head>
                     <body>

                     Let's explore the wonderful world of HTML
                     </body>
                     </html>

                160     Touchpad Web Applications-XI
   157   158   159   160   161   162   163   164   165   166   167