Page 67 - CA_165_V2.0_Flipbook
P. 67

LEFTMARGIN and TOPMARGIN Attribute
                 Margin refers to the blank space from the edge of a page. It is similar to the margin on the page of a book.
                 On the web pages the margin can be given with the help of LEFTMARGIN and TOPMARGIN attribute.
                 The syntax for using the LEFTMARGIN attribute with the <BODY> tag is as follows:

                   <BODY LEFTMARGIN = "Value"> Where 'value' is in pixels.
                 For example:
                   <BODY LEFTMARGIN = "80" >
                 This will leave a blank space of 80 pixels from the left edge of the web page and the text will appear after
                 a blank gap of 80 pixels only.
                 Similarly, top margin can also be adjusted. Top margin is the blank space left from an upper edge of a
                 Web Page. The syntax for using the TOPMARGIN attribute with the <BODY> tag is as follows:

                   <BODY TOPMARGIN = "Value" >
                 For example:

                   <BODY TOPMARGIN = "60" >
                 <HTML>
                 <HEAD>

                 <TITLE> Using Margins </TITLE>
                 </HEAD>

                 <BODY LEFTMARGIN = "80" TOPMARGIN ="50">
                 Setting Margin from Top and Left
                 </BODY>
                 </HTML>
                                      Notice the top margin (the blank area at the top of the web page)
                                                caused by the TOPMARGIN attribute.
















                                      Notice the left margin (the blank area at the left of the web page)
                                                caused by the LEFTMARGIN attribute.
                         Notes


                         The LEFTMARGIN and TOPMARGIN attributes are not supported in HTML5.












                                                                                         Introduction to HTML    65
   62   63   64   65   66   67   68   69   70   71   72