Page 79 - CA_165_V2.0_Flipbook
P. 79

The output of the preceding HTML code is as follows:
                                                A horizontal line with a thickness of 2px,
                                                    width covering the entire screen.

















                 SIZE Attribute
                 This attribute of <HR> tag is used to set the thickness of the line in pixels. The value for the size attribute
                 can  be  specified  in  pixels,  not  percentage.  The  default  size  value  is  2.  The  syntax  for  using  the  SIZE
                 attribute with the <HR> tag is as follows:

                   <HR SIZE= "Value">
                 Here, ‘Value’  indicates the thickness of the line in pixels. For example:

                   <HR SIZE= "5">
                         Notes

                         The SIZE attribute is not supported in HTML5.



                 NOSHADE Attribute
                 This attribute is used to remove shade from the line. It produces a grey line without any shade. If noshade
                 is not specified, the ruler has a filled in or 3D shade effect. To have a flat, 2D ruler line just add noshade
                 with <HR> Tag. The syntax for using the NOSHADE attribute with the <HR> tag is as follows:

                   <HR NOSHADE>
                 For example:

                   <HR SIZE = "15" NOSHADE>
                         Notes

                         The NOSHADE attribute is not supported in HTML5.



                 WIDTH Attribute
                 This attribute is used to change or set the width of a horizontal rule. The width can be set in pixels or in
                 percentage.

                 The percentage is based on the browser window’s width. By default, the size of the horizontal ruler is as
                 wide as the size of a page. The syntax for using the WIDTH attribute with the <HR> tag is as follows:
                   <HR WIDTH ="NUMBER IN PIXEL"> Or <HR WIDTH="PERCENT">
                 For example:

                   <HR WIDTH=45%>

                                                                                         Introduction to HTML    77
   74   75   76   77   78   79   80   81   82   83   84