Lesson 7: Horizontal Rules


Return to Lesson 6

Continue on with Lesson 8


A horizontal rule is a line placed in your document to divide the sections. <HR> places a line wherever you put the tag in the document. You can change the attributes of the horizontal line by adding a statement to the <HR> tag as we did with the alignment statements. <HR SIZE=number> This will tell how thick the line is. <HR WIDTH=number or percent> This tells the exact width in pixels or what percent of the document width you want the line to be. <HR ALIGN=LEFT, CENTER, or RIGHT> This tells where you want the line placed on the page. Note: you can only align a horizontal rule when you are using the WIDTH statement. Otherwise there will be no apparent change in your document. Assignment 7 Open the assignment from lesson 6 and add a horizontal rule between the two rhymes. Check this in your browser. Then add attributes to the horizontal rule and check in the browser to see how the appearance of your document has changed. <HTML> <HEAD><TITLE>Rhymes</TITLE></HEAD> <BODY> <P>Mary had a little lamb <BR> It's fleece was white as snow<BR> But everywhere that Mary went<BR> The lamb was sure to go.</P> <HR> <P>Hickory Dickory Dock<BR> The mouse ran up the clock<BR> The clock struck one<BR> The mouse ran down<BR> Hickory Dickory Dock</P> </BODY> </HTML> Make these changes to the <HR> tag: <HR SIZE=4> <HR WIDTH=150> <HR WIDTH=50%> <HR WIDTH=50% ALIGN=RIGHT> <HR WIDTH=100 ALIGN=CENTER> end of lesson