HTML Tips

The following snipets of html code will allow you to fine tune formatting within your pages.

  1. Paragraph Tag = Using the code: </p><p> to force a double space between paragraphs.

  2. Bold Tag = Using the code: <b> Text that you want to be bold.</b> will display as Text that you want to be bold.

  3. Heading Tag = Using the code: <h3> Text that you want to be in the heading </h3> will display as     

Text that you want to be in the heading.

  4. Break Tag = Using the code: <br> will force a single line break.

  5. Center Tag = Using the code: <center> Text that you want to be displayed centered</center> will display as

Text that you want to be displayed centered

Create a link:

Example: Create a link to the Pro Entertainment Network home page.

<A HREF="http://www.proentertainment.com" target="_blank">Click Here For Pro Entertainment</A>

would create:

Click Here For Pro Entertainment


Here is a basic html primer:

HTML Flags

HTML works in a very simple, very logical, format. It reads like you do, top to bottom, left to right. That's important to remember. HTML is written with TEXT. What you use to set certain sections apart as bigger text, smaller text, bold text, underlined text, is a series of flags.

Think of flags as commands. Let's say you want a line of text to be bold. You will put a flag at the exact point you want the bold lettering to start and another flag where you want the bold lettering to stop. If you want just a word to be italic, you will place a start italic flag at the beginning of the word and an end italic flag at the end of the word. Is this making sense so far?


Flag Format

All flag (I sometimes call them command) formats are the same. They begin with a less-than sign: < and end with a greater-than sign: >. Always. No exceptions. What goes inside the < and > is the flag. Learning HTML is learning the flag to perform whatever command you want to do. Here's an example:

The flag for bold lettering is "B". That makes sense.

Here's what the flags look like to turn the word "Joe" bold:

<B>Joe</B>

Look At What's Happening:

1. <B> is the beginning bold flag.
2. "Joe" is the word being affected by the <B> flag.
3. </B> is the end bold flag. Notice it is exactly the same as the beginning flag except there is a slash in front of the flag command.
4. This is what the bold flags above produced: Joe Nice, huh?

Some Questions

Q. Is the end flag for other commands simply the begin flag with the added slash?
A. Yup.

Q. Will the flags show up on my page?
A. No. As long as your commands are inside the < and > marks, the flag is used to alter the text, but the actual code is hidden from the viewer.

Q. Your bold flag uses a capital "B". Do all HTML flags use a capital letter?
A. The browser doesn't care. In terms of flags, capitals and lowercase letters are equal. But I think it would be a very good idea for you to make a habit of writing your flags in capital letters as it sets them apart from the normal text. It also makes them easier to pick out later when you are revisiting the code.

Q. Must everything have a flag to show up on the page?
A. No. If you just type in text, it'll show up. But it will not have any special look.

Q. What if I forget to add the end flag or forget to add the slash to the end flag command?
A. That's trouble, but easy-to-fix trouble. It will be obvious if you've not placed an end flag when you look at the document in your browser. The entire document will be affected after the point where you forgot the end flag. Just go back into the document, add the slash, and reload the document into the browser.

Q. Do all HTML flags require both a begin and end flag, like above?
A. No. There are exceptions to the rule, but let's stay on the ones that do require both flags to work for now. Moving along...


Open and Close Flags

The majority of HTML flags do require both an open and a close flag (a begin and end flag). Most are very easy to understand because the flag is obvious. Here are a few and what they do to text:

AffectCodeCode UsedWhat It Does
BOLDB<B>Bold</B>Bold
ItalicI<I>Italic</I>Italic
TypewriterTT<TT>Typewriter</TT>Typewriter

Can I Use Two Flags at Once?

Yes. Just make sure to begin and end both. Like so:

<B><I>Bold and Italic</I></B> gives you Bold and Italic

<B><TT>Typewriter and Bold</TT></B> gives you Typewriter and Bold

     If you do use multiple flags to alter text, make a point of not getting the end flags out of order. Look at this:

<B><I><TT>Text Text</TT></B></I>

     In terms of format, the example above is not correct. The end flags are out of order in relation to the start tags.

Follow this rule:
Always set the beginning and end tags at the same time, always placing them on the farthest end of the item being affected.

Here, again, is the example above in correct form:

<B><I><TT>Text Text</TT></I></B>

     Notice the Bold flags are on the far ends. Next in line are the Italics and finally the Typewriter Text flags are closest to the affected text. Just keep setting commands at the farthest ends each time you add them and you'll stay in good form.


Single Flags

The open and close flag format dominates the majority of the available HTML flags, but there are flags that stand alone. Here are three I use extensively:

FlagWhat It Does
<HR>This command gives you a line across the page. (HR stands for Horizontal Reference.) The line right above the words "Single Flags" was made using an <HR> flag.
<BR>This BReaks the text and starts it again on the next line. Remember you saved your document as TEXT so where you hit ENTER to jump to the next line was not saved. In an HTML document, you need to denote where you want every carriage return with a <BR>.
<P>This stands for Paragraph. It does the exact same thing as the <BR> above except this flag skips a line. BR just jumps to the next line, P skips a line before starting the text again.
Heading Commands

Heading commands are used extensively in HTML documents to, you guessed it, create headings! How novel.

There are six (6) heading commands: <H1> through <H6>. <H1> is the largest and <H6> is the smallest. Here are their relative sizes:

<H1>This is Heading 1</H1>

<H2>This is Heading 2</H2>

<H3>This is Heading 3</H3>

<H4>This is Heading 4</H4>

<H5>This is Heading 5</H5>
<H6>This is Heading 6</H6>

Note: In later-version browsers (3.0 and above), the numbers 7 and 8 have been added, but in terms of size, there isn't a great deal of difference between them and the 6 heading.

Heading commands create nice, bold text, as shown above, and are quite easy to use. It's a simple H# and /H# command. However, they do have one annoying trait. They like to be alone.

When you use a heading command, by default, you set the text alone. It's like the heading commands carry a <P> command with them. You cannot get other text to sit right up against a heading. It's as if it wants to be, dare I say, a "Heading." Try a few for yourself.


Font Color Commands

Use a tag of font color="#XXXXXX" to control font color. Be sure to include the quotes and pound sign preceding the six digit color number from the chart below. The text needs to be followed by a close font tag.

i.e. <font color="#990000"> Maroon Text </font> produces: Maroon Text

FFFFFFFFCCFFFF99FFFF66FFFF33FFFF00FFFFFFCCFFCCCCFF99CCFF66CCFF33CCFF00CC
FFFF99FFCC99FF9999FF6699FF3399FF0099FFFF66FFCC66FF9966FF6666FF3366FF0066
FFFF33FFCC33FF9933FF6633FF3333FF0033FFFF00FFCC00FF9900FF6600FF3300FF0000
CCFFFFCCCCFFCC99FFCC66FFCC33FFCC00FFCCFFCCCCCCCCCC99CCCC66CCCC33CCCC00CC
CCFF99CCCC99CC9999CC6699CC3399CC0099CCFF66CCCC66CC9966CC6666CC3366CC0066
CCFF33CCCC33CC9933CC6633CC3333CC0033CCFF00CCCC00CC9900CC6600CC3300CC0000
99FFFF99CCFF9999FF9966FF9933FF9900FF99FFCC99CCCC9999CC9966CC9933CC9900CC
99FF9999CC9999999999669999339999009999FF6699CC66999966996666993366990066
99FF3399CC3399993399663399333399003399FF0099CC00999900996600993300990000
66FFFF66CCFF6699FF6666FF6633FF6600FF66FFCC66CCCC6699CC6666CC6633CC6600CC
66FF9966CC9966999966669966339966009966FF6666CC66669966666666663366660066
66FF3366CC3366993366663366333366003366FF0066CC00669900666600663300660000
33FFFF33CCFF3399FF3366FF3333FF3300FF33FFCC33CCCC3399CC3366CC3333CC3300CC
33FF9933CC9933999933669933339933009933FF6633CC66339966336666333366330066
33FF3333CC3333993333663333333333003333FF0033CC00339900336600333300330000
00FFFF00CCFF0099FF0066FF0033FF0000FF00FFCC00CCCC0099CC0066CC0033CC0000CC
00FF9900CC9900999900669900339900009900FF6600CC66009966006666003366000066
00FF3300CC3300993300663300333300003300FF0000CC00009900006600003300000000
FFFFFFCCCCCC999999666666333333000000

Font Size Commands

Maybe you'd like a little more control over your text size. Well, here it is. The <FONT SIZE> commands. Heading commands are great for right at the top of the page, but these font commands are going to end up as the workhorses of your pages.

There are twelve (12) font size commands available to you:

+6 through +1 and -1 through -6.

As you've probably guessed, +6 is the largest (it's huge); -6 is the smallest (it's a little too small). Here are a few of them in action. There's no need to show all of them. You'll get the idea of their relative sizes. Follow this pattern to place one on your page.

<FONT SIZE="+3">This is +3</FONT>

<FONT SIZE="+1">This is +1</FONT>

<FONT SIZE="-1">This is -1</FONT>

<FONT SIZE="-6">This is -6</FONT>

Notice that this first command, <FONT SIZE="--"> is actually doing two things:

1. It's asking for a new font size...
2. then offering a number to denote the font size.

This is what I like to call a command inside of a command. The technical HTML term is an "attribute". When you have that, you denote the attribute with an equal sign and enclose it within quotation marks. Look above. See the equal sign and the plus or minus number in quotes? That's what I'm talking about.

Also notice that the end command for a <FONT SIZE="--"> flag only requires </FONT>. I should tell you now that there are two other attributes you can use inside the FONT flag: COLOR and FACE (these both have tutorials unto themselves. Take a look). But even if you use all three inside a FONT flag, you still only need one </FONT>.

Remember that an attribute is inside of a flag. When you use an end command, you are closing the flag, not the attribute. So you only need the one end flag, like above.


Centering Text

Since you've already done some writing you've no doubt noticed that the text that appeared in the browser window was justified to the left of the screen. That's what's known as the default. It just happens without your specifying any particular justification.

Notice that this text is centered on the page. It's done by surrounding the text you want centered with simple <CENTER> and </CENTER> commands.

Here's what it looks like:

<CENTER>

All text in here will be centered

</CENTER>


Text To The Right

Can you get text to the right? Sure. It's done by setting the text aside as a paragraph unto itself. I'm going to use the <P> command you learned in
Primer 2, but now I'm going to alter it. I'm going to add an attribute to it.

Here's the format:

<P ALIGN="right">Text in here is pushed to the right</P>

See how I added the ALIGN="right" attribute to the <P> command? Okay, but you also have to remember that if you add an attribute to a single flag like the <P> flag, or the <BR> flag (yes, there are attributes for BR), then you'll need to use an end flag. See the </P> up there?

If you're just using <P> to create a new paragraph, then it can sit all by its lonesome. But the moment you add an attribute=, you need to use the end flag.

Creating A Hypertext Link

Welcome to day four. Today you will learn only one thing: How to create a link to another page. It's a set flag format like any of the others you have seen so far. Once you learn the format, you can make as many links as you want to any other page you want.

Now an example: What is below would create a link to the HTML Goodies home page.

<A HREF="http://www.htmlgoodies.com">Click Here For HTML Goodies</A>
Here's What's Happening

Here's what will appear on the page using the command above...

Click Here For HTML Goodies

Now, without clicking, simply lay your pointer on the blue words. You'll see the address of the link you created come up along the bottom of the browser window, down where it usually reads "Document Done".

What To Write For The Link?

There are a couple different schools of thought on this. One suggests that what you write for links should be quite blatant. This includes text like "Click here for this" or "Here's a link to...". The other states that since the hypertext links will be blue (or whatever color they're set to), that the links should be just another word in the text set up as a link.

I believe a little of both. I'm of the opinion your readers should be allowed to have a very easy time of it all in terms of navigating your Web pages. But it's your page and you make that decision.


E-Mail Links From Your Page

This is what's known as a mailto: command. It follows the same coding scheme as the hypertext link above. What this format does is place blue wording on the screen that people can click to send you a piece of e-mail.

Here's the pattern:

<A HREF="mailto:jburns@htmlgoodies.com">Click Here To Write Me</A>

Notice it's the same format as a link except in a link you write "mailto:" in place of the http:// and your e-mail address in place of the page address. Yes, you still need the </A> flag at the end. Please notice there is NO SPACE between the colon and the e-mail address.

Here's what you get using the "mailto:" command above:

Click Here To Write Me

Go ahead, click on it. I know you're dying to. You'll get an e-mail dialogue box addressed to me. Then you can write if you want. The same thing will work for you. Just place your e-mail address in place of mine following the format above.

Here's the format for placing an image:

<IMG SRC="image.gif">

By replacing "image.gif" with "homepage.gif", one of my own graphics, you get this...

Here's What's Happening


Image Formats

There are three basic formats you will find on the World Wide Web. Each is denoted to the browser by a different suffix. Remember that "name.suffix" discussion from Primer #1?


Where Do I Get Images For My Page?

They are literally everywhere. The HTML Goodies Images Page allows you access to over 500 for free, and there are other sites out there that offer just as many. Plus, since you've been surfing, you've seen hundreds of images already. If you see something on someone's page that you really like, ask to use it. Don't just take it. That's not right and could be against copyright law. Ask. You'll probably get the image. In no time you'll have a slew to use on your page.


Activating An Image

Okay, this gets a little fancy. In Primer #4, I showed you how to create a hypertext link. What it did was create blue words on your page so someone could click on them and then jump to another site. Well, here we're going to set it up so an image becomes clickable or "active." The viewer would click on the image, instead of on blue words, to make the hypertext link. I'll make a link to my home page using the image above.

Here's the format:

<A HREF="http://www.htmlgoodies.com"><IMG SRC="homepage.gif"></A>

Look at it again. See what happened? I placed an image flag where I would normally have placed words. Here's what you get with that format. Lay your pointer on the image, but don't click. You'll see the entire image is active:

Neat, huh? But what's with that new border around the image? That's what happens when you activate an image. It attempts to turn blue, or whatever color the page is set to, like the wording it's replacing, so it places what's known as a "border" around the image. Some people like it. I don't, and I know how to get rid of it.

To make the border disappear, you again turn to a trusty attribute, a command inside of a command.

Here's the format:

<IMG BORDER="0" SRC="homepage.gif">

See what I did? I added an attribute that denoted that the border should be 0. You can go the other way too if you'd like. Make it BORDER="55" if you want. It'll just make a huge border. Note that the number 0 is in quotes. It is an attribute, after all.

Bullet Lists

These lists are nice. Here's why I like them...
  • They present information in an easy fashion.
  • The bullets look cool.
  • They make me happy.

     Sorry about that last one. I just needed another item to make a three-item list. OK, here's how I did it.

<UL>
<LI>They present information in an easy fashion.
<LI>The bullets look cool.
<LI>They make me happy.
</UL>

      Don't be put off by the commands. It's actually only two being used again and again. Here's what's happening.

  • UL stands for Unordered List. It means bullets will be used rather than numbers. Numbers will be explained later.
  • LI stands for List Item. It denotes the next thing that will receive a bullet. Please note that no </LI> is required. Neither is a Break or Paragraph command. The LI does all that good stuff for you.
  • /UL ends the entire list.

    HINT: If you use a center command before this, it doesn't center the entire list, it centers each item messing up the look of the list. If you would like to move the list closer to the center of the page, simply add more <UL> commands. I have found that three moves the list almost to the center. Just remember, if you use three UL commands you need to offer three /UL commands. Like this:

<UL><UL><UL>
<LI> list item
</UL></UL></UL>


I don't like round bullets, I want squares!!!

     Easy now there fellah, you can have your list and squares too. Simply add the command TYPE="square" into your UL command. Like so:

<UL TYPE="square">
<LI>List Item 1
<LI>List Item 2
<LI>List Item 3
</UL>

This is what you get...

  • List Item 1
  • List Item 2
  • List Item 3


Number Lists

     If you would like to create a list that numbers the items rather than just putting a bullet in front, HTML could do that for you too. Yeah, you could just number the things yourself, but that's no fun. It's time consuming too. Dig this:

  1. List Item 1
  2. List Item 2
  3. List Item 3

...and here's how I did it:

<OL>
<LI>List Item 1
<LI>List Item 2
<LI>List Item 3
</OL>

     Notice it's just the same format except I have <OL> where <UL> used to be. Nothing to it. The browser will continue to count up as long as you keep putting <LI> items after the OL. By the way, "OL" stands for Ordered List.

But I Want Roman Numerals!!!

     Arabic isn't good enough for you, huh? Well simply place a TYPE="I" inside the OL command. Notice that is a capital "I" and not the number one. Here's what you get:

  1. List Item 1
  2. List Item 2
  3. List Item 3

...and here's how I did it:

<OL TYPE="I">
<LI>List Item 1
<LI>List Item 2
<LI>List Item 3
</OL>

Roman Numerals?!?! I Want Letters!

     You're just no fun, you know that? OK, regular letters. I can do that. Try this:

  1. List Item 1
  2. List Item 2
  3. List Item 3

...and here's how I did it:

<OL TYPE="A">
<LI>List Item 1
<LI>List Item 2
<LI>List Item 3
</OL>


Start the Count After One

     Maybe you don't want your count to start at one every time. That's easy to fix. Here's an ordered list that starts at four.

  1. List Item 1
  2. List Item 2
  3. List Item 3

...and here's how I did it:

<OL START="4">
<LI>List Item 1
<LI>List Item 2
<LI>List Item 3
</OL>

Try it yourself.


Can I put these together?

     Yes. Just remember to close each one. You could do something like an OL list and under each LI command for the OL, you could put in a small UL. Like so:
  1. Main Heading
    • List item 1
    • List item 2
  2. Secondary Heading
    • List item 1
    • List item 2

here's what it looks like:

<OL>
<LI>Main Heading
<UL>
<LI>List item 1
<LI>List item 2
</UL>
<LI>Secondary Heading
<UL>
<LI>List item 1
<LI>List item 2
</UL>
</OL>

     There is a pattern to putting unordered lists under one another.

  • The first list gives you the solid bullet
  • The second gives you the empty bullet. You can see that above.
  • Each list after that gives you a square bullet.
back to the site     |     inventory     |     add page
Email support

Phone support: 303-233-4222