Thursday, 8 August 2013

<hr> -- Horizontal line :
  • <hr> tag is used draw horizontal line in webpage.
  • <hr> tag doesn't contain any closing tag.
  • By default line width="100%".
  • we can reduce line width by using width attribute.
Syntax:
                 <hr>
Where ever you need horizontal line just place <hr> tag.

Example:
<html>
        <head>
               <title>Horizontal Line</title>
       </head>
       <body>
                <h3>welcome to Horizontal Line</h3>
               <hr/>
      </body>
</html>

In this example we are drawing line after "welcome to Horizontal line".
output:

For Demo : Click Here

<hr> tag with attribute:
Mainly <hr> tag contains width,size,align and color attributes
width: It deal with width of horizontal line.
size: It deal with thickness of line.
color : It represent line color.
align: line alignment (left,center,right)
Syntax:
         <hr align="center" width="50%" size="1" color="gray">
Example:
          <html>
                    <head>
                               <title>Horizontal Line</title>
                   </head>
                   <body>
                                <h1>welcome</h1>
                               <hr align="left" size="1" width="100%" color="red">
                              <br>
                             <hr align="center" size="3" width="50%" color="black">
                             <br>
                             <hr align="right"  size="5" width="30%" color="blue">
                 </body>
     </html>
In above example drawing three lines with different width ,color,size and alignment.
output:

For Demo : Click Here 


0 comments:

Post a Comment