/showcontent.asp?artid=19680 HTML Tutorial Chapter 3

fortypoundhead.com

HTML Tutorial Chapter 3

Posted On 2009-02-08 by FortyPoundHead
Keywords:
Tags: Webmaster Related Tutorial 
Views: 1420


Paragraphs...

You will often use paragraphs in HTML, just as you do when you write stories. The opening tag for a paragraph is <p>, and the closing tag is </p>. The closing tag for a paragraph is not always needed, but I recommend using it anyway.

Example of a paragraph...

Bob starts to chase the chicken around. Bob trips over a string and goes flying into the pig's mud pit! eww! What a pity!


<p>Bob starts to chase the chicken around. Bob trips over a string and goes flying into the pig's mud pit! eww! What a pity!</p>



Text Formatting Properties...

If you had an entire web page without formatted text, it would look rather dull and boring.
This is why we use text formatting tags.
Some common text formatting tags are:
<b> and </b> for bold,
<i> and </i> for italics,
<u> and </u> for underlined, and
<tt> and </tt> for typewriter.

Text Formatting Properties...Font Tags

The <font size=n> and </font> tags come in handy.

n is the number of font points by which to change the size of the current font.

n can be positive or negative: a positive number will increase the font size, and a negative number will decrease it.

n can also be an absolute number, indicating an absolute size for the font (not a relative size).

Example of font tags...

Bob is a Cool Guy isn't he?

<font size=+1>Bob</font> <font size=+2>is</font> <font size=+3>a</font> <font size+2>Cool</font> <font size=+1>Guy</font> isn't <font size=-1>he?</font>




ALIGN attributes...

Many tags support ALIGN attributes... if you want something to be aligned from the left margin, from the center, or from the right margin. The ALIGN attribute is placed in the opening tag before the >.

Left Align


<h1 align=left>Left Align</h1>

Center Align


<h1 align=center>Center Align</h1>

Right Align


<h1 align=right>Right Align</h1>


The Line Break...

When your HTML document is viewed, normally the text will do a word-wrap at the end of a line. If you want to have the text BREAK (go to another line) you will use the <br> tag. This tag has no closing tag.
Example WITHOUT line Break...


Sentence One.
Sentence Two.
Sentence Three.

Sentence One.
Sentence Two.
Sentence Three.


Example WITH line Break...


Sentence One.

Sentence Two.

Sentence Three.


Sentence One.<br>
Sentence Two.<br>
Sentence Three.<br>



Preformatted Text...


If you wish to have text line up properly (a.k.a. fixed width text) that will include line breaks without the use of the <br> you may find the <pre> and </pre> tags helpful.


Example of text WITHOUT preformatting...


The cat ran after the dog.
^ ^-verb ^noun
^-noun




The cat ran after the dog.
^ ^-verb ^noun
^-noun




HTML ignores the extra line breaks, so the text does not line up properly.

Example of text WITH preformatting...



The cat ran after the dog.
^ ^-verb ^noun
^-noun




<pre>
The cat ran after the dog.
^ ^-verb ^noun
^-noun
</pre>






Your own HTML page...


Add the following to your HTML page ("Home.htm"), between the lines <body> and </body>:




<h1>YOURNAME's Home Page</h1>

<hr>

This is the home page of <b>YOURNAME</b>.

<p>Type something about yourself here. Describe briefly who you are and what you do for a living. Remember to use bold and italic text, for emphasis.</p>




Save the text file as "Home.htm".


About the Author

FortyPoundHead has posted a total of 1974 articles.

 


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.224.214.93

Before you can post, you need to prove you are human. If you log in, this test goes away.



Recent Forum Posts

Job Spammer: Prutha Siri - Javelin Systems
dwirch posted on September 10, 2017 at about 6:15 in Spammers

New security implemented
dwirch posted on September 7, 2017 at about 7:16 in Site News

Malicious IP Checker Companion Tool
dwirch posted on August 12, 2017 at about 20:24 in Site News

Job Spammer: Steve Adams
dwirch posted on August 8, 2017 at about 7:44 in Spammers

New security implemented
dwirch posted on August 8, 2017 at about 6:43 in Site News

New security implemented
dwirch posted on July 23, 2017 at about 6:58 in Site News