Friday, August 04, 2006

1. Paragraphs, Line Breaks, and Horizontal Lines

 <p>  </p> ,  <br> ,  <hr>  (04/08/2006)

Section 1:
  • Surround your paragraphs with the  <p>  </p> tags for a paragraph.
  • The  <br>  tag starts a new line without skipping any space.
  • To draw a line across the screen, use  <hr>  (for "horizontal rule").
TagHow to use itWhat it
looks like
<p> </p><p> Bid on my item! </p>
<p> You'll enjoy it! </p>

Bid on my item!

You'll enjoy it!

<br>Bid on my item! <br> You'll enjoy it!Bid on my item!
You'll enjoy it!
<hr>Bid on my item! <hr> You'll enjoy it!Bid on my item!
You'll enjoy it!


Attribute for <P ...>


ALIGN = LEFT | CENTER | RIGHT | JUSTIFY


ALIGN indicates the alignment of the paragraph.

<P ALIGN=LEFT>
This is aligned left. This is the default.
</P>
<P ALIGN=CENTER>
This is aligned center.
</P>
<P ALIGN=RIGHT>
This is aligned right.
</P>

produces


This is aligned left. This is the default.



This is aligned center.



This is aligned right.




<BR ...>

<BR ...> inserts a single carriage return. Whereas <P ...> indicates the start of a new paragraph, <BR ...> only implies a carriage return within the same paragraph. <BR ...> is usually rendered with a single carriage return.

For example, this code:



There once was a man from Nantucket<BR>
Who kept all his dough in a bucket<BR>
His daughter name Nan<BR>
Ran away with a man<BR>
And as for the bucket, Nantucket

produces this

There once was a man from Nantucket

Who kept all his dough in a bucket

His daughter name Nan

Ran away with a man

And as for the bucket, Nantucket




Attribute for <HR ...>


WIDTH = "width expression"


WIDTH sets the horizontal width of the rule. You can express the size in pixels or as a percentage.

<HR WIDTH="50%">
<HR WIDTH="100%">
<HR WIDTH="200">
<HR WIDTH="300">











Attribute for <HR ...>


ALIGN = LEFT | RIGHT | CENTER

ALIGN sets the alignment of the rule. ALIGN is only useful if you also use WIDTH.


<HR WIDTH="40%" ALIGN=LEFT>
<HR WIDTH="40%" ALIGN=CENTER>
<HR WIDTH="40%" ALIGN=RIGHT>


gives us









No comments: