| [Index of Lessons] [Lesson 2] [Lesson 4] |
3. Paragraphs and Hard Rules |
| So far you have created and modified a HTML document, and now you
should feel comfortable with the process of editing text and
reloading it into your web browser. We've seen earlier that a web browser will ignore all of the CARRIAGE RETURNS typed into your text editor. But, wherever a browser sees the paragraph tag, it inserts a blank line and starts a new paragraph. The HTML code for forcing a paragraph break is: <
Note that this tag is special in that it does not require an ending tag; you do not need to use:
In a later lesson we will see an instance where the <p> tag does use a closing </p> but for the majority of your web pages, it is not necessary. Also note the header <h2> tags have a built in break so it is unnessary to put <p> tag before a header tag: |
Other types of breaks |
|
| To separate major sections of a web page, use the hard rule
or hr tag. This inserts a straight line like you see below this paragraph.
The HTML format for a hard rule tag is: |
|
| The hard rule is a usefule separating tool, because it breaks the monotomy of a straight page. But one should never go over board in putting in the hard rule. | |
| And finally, there is the <br> tag which forces text to a new line like the <p> tag, but without inserting a blank line. You might use this tag when making a list of items, when writing the lines of a poem, etc. Compare the differences between using the <br> and <p> in the below example: |
| Paragraph <;p>; and Line Break <;br>; tags | ||
| HTML | Result | |
At first,one could not see<;br>; the brilliant purpose<;br>; of the paragraph tag. <;p>; Moving on... <;br>; the more tags you write,<;br>; the better you get at it. |
At first,one could not see the brilliant purpose of the paragraph tag.
Moving on...
|
|
| Example Okay, so now that you have seen them in action, let's use them for our web page. You have seen the <p> tag in use already, though now you understand what it does. What we'll do is add a few more headings, and some text underneath those, we'll probably add a hard rule to separate the sections.
<html> Like before, add all of this to your first web page by opening the document and editing the page. To speed it up, you can cut and paste the code. After you have done all of this, click here (Example 3) to compare your work to the example provided. As you can see, the page still looks dull, this will change as you carry on. Though as you can see, it should be an interesting read.
|
|
| Click on Lesson 4 to continue, or click here (Top) to return to the top of document |