Page 77 - Plus_V2.2_C6_Flipbook
P. 77

Attributes

                 An attribute is a property that provides some additional information about a tag. It enhances the
                 functionality of a tag. It is always specified inside the opening tag. All attributes consist of two parts:
                 a name and a value.
                 The ‘name’ is the property that you want to set.

                 The ‘value’ is what you want for the respective property.
                 For example,
                 <body style="color: red;">

                 The text colour is red now.
                 </body>
                 Here the attribute is "style" whose value is “red” which is used inside the <BODY> tag.


                      Rules for writing HTML5 codes
                 There are certain rules for writing HTML codes. Let us learn about them:

                 1.   Tags names are case insensitive and may be written using any case. (upper case, lowercase or
                    mixed case) but the most common convention is to use lowercase.
                 2.  Attribute values are optional.

                 3.  Quotes are optional for attributes.
                 4.  Closing empty elements are optional.


                      HTML5 Document Structure
                 An HTML document consists of text or the content that is displayed on the web page. The markup tags
                 tell the Web browser how to display the web page. A HTML file is saved with .htm or .html extension.

                 A standard HTML document structure is as follows:

                  <!DOCTYPE HTML>
                  <HTML>
                  <HEAD>

                  <TITLE>Title of the web page</TITLE>
                  </HEAD>
                  <BODY>
                  Content of the page
                  </BODY>
                  </HTML>



                 <!DOCTYPE HTML> Tag
                 The <!DOCTYPE html>tag declaration is used to mention the version of HTML the document is using.
                 This is referred to as the document type declaration (DTD). This is the first tag written at the beginning

                 of the HTML document.


                                                                                             Introduction to HTML5  75
   72   73   74   75   76   77   78   79   80   81   82