On of the first things we need in our web page is a headline. We use the <h?></h?> to create a headline or subheading. The ? is replaced by a number one through six. One is the largest 6 and is the smallest
Let's try some Headlines. Add the following to the body of your page.
<h1>This is a headline 1</h1> <h2>This is a headline 2</h2> <h3>This is a headline 3</h3> <h4>This is a headline 4</h4> <h5>This is a headline 5</h5> <h6>This is a headline 6</h6> |
After reloading your page you should see some like the table below:
This is a headlineThis is a headlineThis is a headlineThis is a headlineThis is a headlineThis is a headline |
However, if you want it to look like this.
This is a headline 1This is a headline 2This is a headline 3This is a headline 4This is a headline 5This is a headline 6 |
You need to download the style steet. Click Here to download style.css, choose "save to disk" and save it in you WebPages folder. Then add this lineto the head section of your document.
</title> <link REL="StyleSheet" HREF="style.css" Type="text/css"> </head> |
Notice that's between the title closeing tag (</title>) and the head closing tag (</head>)
You can also use an align atribute to align headlines right, center or left which is the default. Try it. Add the following to the headlines on you page:
<h1 align= "center">This is a headline 1</h1> <h2 align= "right">This is a headline 2</h2> <h3 align= "left">This is a headline 3</h3> <h4 align= "center">This is a headline 4</h4> <h5 align= "right">This is a headline 5</h5> <h6 align= "left">This is a headline 6</h6> |
<b></b> Creates bold text
<i></i> Creates italic text
<u></u> Creates underline text
OK, now let's see them in action. Add the following to the body of you page:
<b>This is bold</b> <i>This is italic</i> <u>This is underline</u> <b><i>This is bold and italic</i></b> <u><i>This is italic and underline</i></u> |
This may look a little screwy in you browser because HTML does not recognize returns in your code. You need to add a <br> tag to end of each line. The <br> tag breaks a line into two lines and you can us it anywhere you like. So add the <br> tags and check you browser again. Then come back because we're just getting started.
<b>This is bold</b><br> <i>This is italic</i><br> <u>This is underlined</u><br> <b><i>This is bold and italic</i></b><br> <u><i>This is italic and underlined </i></u> |
A word about nesting tags. Whenever we placed tags inside other tags it's called nested and there is a rule. The rule is simple, what is first shall be last and what is last shall be first. What is mean is, whatever tag you open first should be closed last and vis versa.
It goes something like this:
<b> <I> bold-italic</I> </b> These two are correct <I> <b> bold-italic </b> </i>
<b> <I> bold-italic </b> </i> These are not <I> <b> bold-italic </I> </b>
That's why I generally put both tags in before in enter the content.
In fact, when I first started using HTML a few 24 hours ago, just kidding, I do is this:
First I put both sides of the tag in like this: <><>. Then I fill in the tag like this: <b></b>. Next if I also want italic I first add the blank tags like this: <b><><></b>. Finally in fill in those tags like this: <b><i></i></b>. Now, if I also want underline, well you get the picture. I did this because one of the biggest pains, espically when learning, about HTML is finding mising pieces of tags. You leave one little > off somewhere and it can cause some real problems.
OK, here's a couple more.
The big (<big></big>) and small (<small></small>) tags will increase or decrease the size to the fort. Font sizes range from one to seven much like headlines except the order is reversed, but we'll get into that in just a minute. Firsy let's fininsh with the structural tags. You can use several big or small tags in a row to get more effect. Let's try it.
Enter the following into the body of your page:
<br><big> This is big </big> <br><small> This is small <small> |
The address tag is most often use for the author's address at the beginning or end of a document. It is generally displayed in italic. Try it just to see how it works
Enter this in your document:
<br><address> <br>Your Name <br>Your Address <br>City, State Zip Code </address> |
Now we'll move on to dividers to see more ways we can spilt up the text on page.
Tags covered in this section
Heading <H? ALIGN=LEFT|CENTER|RIGHT></H?> Defines six headline levels
Bold <B></B> Bold
Italic <I></I> Italic
Underline <U></U> Underline
Large Font Size <BIG></BIG>
Small Font Size <SMALL></SMALL>
Author's Address <ADDRESS></ADDRESS> Usually displays in italic.