![]() |
Shining Star Services LLC
|
|
RETURN TO HTML TUTORIAL HOME HTML Text Formatting By Nannette Thacker - 01/30/2001 Perhaps you'd like to be different and add content to your web page? hehe Here are the commands we will learn on this page:
Below are examples of how to use the above commands.
Notice how the above source code, creates the below text: Now is the time for all good women to come to the aid of the men.
Some things I'd like to point out:
Creates:
Hello Nurse!
Using the FONT tag, you may add attributes to set the color and size. Even though using SIZE="+2" is a valid attribute, I prefer using one of the seven sizes, such as SIZE=1 SIZE=2 SIZE=3 through 7 -- SIZE=1 being the smallest and SIZE=7 being the largest. (Note: SIZE=1 results in the same thing as SIZE="1" or SIZE='1'. However, if you plan to program for PALM PILOTS, avoid using the single quote marks in your form field elements.) Play around with the above command using different sizes with different text to see how it works. I won't even discuss the <H1> Head tags. I don't use them, nor do I recommend the ugly things. :) Of course, I program using Active Server Pages and Cascading Style Sheets, so I have a better solutions for Heads, which is beyond the scope of this page. Suffice it to say, I recommend setting the SIZE=3 or SIZE=4, putting a BOLD <B> tag around the head, and possibly changing the color, like so:
Which will create this:
The Hot Sun
Okay, so I hate hot sun. But notice the BOLD tags in the above example. One is in CAPS and the other lower case. It doesn't matter. Mix and match -- HTML is not case sensitive. There are geeks out there who will say "Blah should be capped and blah should be lower case." Who cares. At the top of this page, I set the FONT tag to:
However, most browsers are set to default to Times Roman, size=3. Try different FONT commands. What the above command does is this: If the user's machine has Verdana, it will use Verdana. If not, it will see if it has Arial and use Arial, if not, it will see if it has Helvetica and use Helvetica (Macintosh), and so forth. Just type the name of the FONT that you want to use. However, don't use some weirdo font that Joe Blow user is likely to not have, or it will default to Times Roman and will mess up your beautiful layout. (Note: HTML TABLEs also need the FONT tag to be redefined for each cell.) Okay, let's do a full paragraph of formatting!
This is Verdana. Notice it is fatter than Arial.
How did I get the font in the grey examples? View the source and see! I use PRE tags and put the text in a TABLE with a grey background. Too early to learn that yet. So wait until we get to tables. There are a few more things to do with text and formatting: Centering & Line Breaks
Line break, with no extra space following. Paragraph break, WITH extra space following.
This is in Arial, size 2.
I now want to change the size to size 3.
So I will. I want to change it back.
Neat! I just closed the size=3 font tag to change it back!
I'm still in the Arial font tag. I have not closed it.
Notice this line: Reverse order to close tags. <b><font face="Times New Roman" size=4><i> I'm going to change to Times New Roman, size 4, bold, italic.</i></font></b>
|
|
