Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 22 - CoreGPT(Podar)_Flipbook_C8
P. 22

    Let us learn more about tags and attributes.
                      Tags

                      Tags are the basic building blocks of a web page. They tell the browser how the information is to
                      be displayed on the web page.

                      Tags do not appear in the browser window but they affect the display of the text and non-text
                      items in it. Each tag in HTML follows specific rules and syntax. HTML tags are not case sensitive.
                      In HTML document, a tag name begins with an opening angular bracket (<) and  ends with

                      closing angular bracket (>). For example,
                                                    <TagName> content </TagName>

                                                     Opening tag                Closing tag

                      Both opening and closing tags are same. The only difference is that the closing tag contains a
                      forward slash in front of the tag name. Most of the tags in HTML have opening and closing tags.
                      A combination of opening tag, content and closing tag is called an element.
                      The HTML tags can be categorised as:

                          Container Tags: A container tag exists in pairs. The first tag is called the Start tag or ON tag;
                          the second tag is called the End tag or OFF tag. The text to be informed is placed between
                          these two tags. An End tag is created by placing a forward slash (/) in front of the Start tag.
                          For example      <B> ...... </B>
                             <HEAD> ...... </HEAD>
                          Empty Tags: Empty tags contain only opening tag. They do not have closing tag. These tags
                          do not enclose any data.
                          For example      <BR>, <HR>, etc.

                      HTML tags can also be further classified as:
                          Block Level Tags: The block level tags take up the full width available and by default begin
                          on a new line. Some of the block level tags are Paragraph <P>, headings <H1> to <H6>,
                          Horizontal Rule <HR>, etc.

                          Text Level Tags: The text level tags are used to mark up parts of text. These tags do not
                          start with new line. Some of the text level tags are Bold <B>, Superscript <SUP>, Italic <I>,
                          Subscript <SUB>, etc.
                      Nesting of Tags

                      Nesting of tags means that you can start a new tag before closing the previous tag. The only
                      point to remember is that tags are nested on LIFO principle, that is, Last In First Out. This means
                      that the tag that has been opened last needs to be closed first.

                      Attribute

                      An attribute is a property that provides some additional information about a tag. It enhances
                      the functionality of a tag. It always specified inside the opening tag. All attributes consist of two
                      parts—a name and a value.

                     20     Premium Edition-VIII

| 17 18 19 20 21 22 23 24 25 26 27 |