Page 157 - CG_v2.1_flipBooks_class_6
P. 157

Rules for Writing HTML Codes

                 There are certain rules for writing HTML codes. Lets us learn more about them:

                   Container tags should always be closed properly.
                   Values given to the attributes should be enclosed within the double quotes.
                   Tag name should not contain spaces.

                   There should be no spaces between < and > in a tag.
                   Tags must be nested correctly.

                 HTML Tags and Attributes

                 In the previous class, you have learned various tags such <HTML>, <HEAD>, <TITLE> and <BODY>.
                 You have also learned attributes of these tags. Let us revise some of those  tags and learn about
                 more tags of HTML.


                      Tags                                           Description

                                 The <HTML> tag tells the web browser that the text contained between <HTML>
                  <HTML>
                                 and </HTML> is a web page and can be viewed using a web browser.

                                 The <HEAD> tag represents the header area of the document. It contains information
                  <HEAD>
                                 about the document title, scripts and style definitions used in the document.

                                 The <TITLE> tag represents the title of the document and is used inside the <HEAD>
                  <TITLE>        tag. It appears on the title bar of the browser window. If you do not want to give
                                 title to your web page, you can skip it.

                                 The <BODY> tag defines that section of the HTML document which is visible on
                  <BODY>         the web browser. It contains all other tags that define the content presentation
                                 elements such as images, lists, tables, text and links to move between the webpages.

                 HTML5 provides different types of tags. For example, tag to create different types of headings, to
                 create a paragraph, to insert a line break, to add a horizontal line, etc. Let us learn about some of
                 them in detail.

                 The <Hn> Tag

                 Every  chapter  in  a  book  has  various  headings  and  sub-headings.  These  are  known  as  levels  of
                 headings.  HTML can define up to 6 levels of headings from H1 to H6. H1 is the first level of heading
                 and H6 is the last level of heading/sub-heading. Let us create a web page using heading tags.
















                                                                                        Introduction to HTML  155
   152   153   154   155   156   157   158   159   160   161   162