Home

Basics

Using Flags

More Text Flags

Placing Images

Colors

Backgrounds

Linking Pages

Tables

Getting Online

HTML Basics, Tips and Tricks
by Fox Bautista

USING FLAGS

 

Okay, before we start doing fancy stuff, you gotta know about flags. Not the kind that you wave around or stick up a flagpole... I'm talking about HTML flags.

What you use to set certain sections apart as bigger text, smaller text, bold text, underlined text, blah blah blah, is a series of flags. Think of them as commands. Let's say you want a line of text to be bold. To accomplish that, you 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 place a "starting" italic flag at the beginning of the word and an "ending" italic flag at the end of the word. Is this making sense so far?

All flag (also known as command) formats are the same. They begin with a less-than sign: < and end with a greater-than sign: >. That's how it ALWAYS is. 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 "HALLELUJAH!" bold:

<B> HALLELUJAH!</B>

Look at what's happening.

1. <B> is the beginning bold flag
2. "HALLELUJAH!" is the word being affected by the flag.
3. </B> is the ending 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: HALLELUJAH! Cool, huh?


Some Questions:

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

Q. Will the flags show up on my page?
A. Nope. 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 consider it a good idea to make a habit of writing flags in capital letters, as it sets them apart from the normal text. It also makes them easier to pick out later when you're reviewing 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 won't have any special look.

Q. What if I forget to add the end flag or forget to add a slash to the end flag command?
A. That can be messy, but it's easy to fix. It will be obvious if you haven't 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. (ack!) 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 for now, let's stay on the ones that do require both flags to work for now.


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:

<B>Bold</B>
<I>Italic</I>
<U>Underline</U>


Using Two Flags at Once

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

<B> and <I> give you Bold and Italic.ÊIf you use multiple flags to alter text, make a point of not getting the end flags out of order. Look at this:

<B><I>Blah Blah</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>Blah Blah</I></B> ÊÊÊÊÊ

Notice the Bold flags are on the far ends. Next in line are the Italics, and finally the Bold 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 usually use:

<HR>


This command gives you a line across the page. (HR stands for Horizontal Reference.) The line right up there 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 above except this flag skips a line. BR just jumps to the next line; P skips a line before starting the text again.


Writing Your First Page

So, here we go... you're going to write your first HTML page using what you've just learned, plus a few other items. And these two items are important to every page you will ever write. Why? Because they'll be on every page you ever write. You'll start every page with this flag: <HTML>.ÊÊÊThat makes sense. You're telling the computerthat this is an HTML document (remember the Basics lesson?). Your next flags will always be these: <HEAD><TITLE> and </TITLE></HEAD>.ÊÊSee the very top of this page? I mean way up top. Above the FILE -- EDIT -- VIEW menus. The colored bar up there. Right now it reads "Using Flags." That's the title of the page, and that's what you're denoting here. Whatever you put between these two flags will show up in the title bar way at the top. After that, you'll denote the body of the document with the <BODY> flag. Finally, you'll end every page you write with these: </BODY></HTML>ÊOkie-dokie? You started the page with <HTML> and so you'll end the page with </HTML>. Same with the body... it started off with <BODY> and should end with </BODY>. That makes sense again.

So, let's go! Here's a sample page to show you what I mean. The text flags show how you they affect the text, to make things easy.

<HTML>

<HEAD><TITLE>My First Page</TITLE></HEAD>
<BODY>

<B>This is my first HTML page!</B>
<P>

I can write in <I>Italic</I> or Bold
<BR>

<B></I>Or I can write in both</I></B>
</BODY>
</HTML>

Ta-daaaa! Yes, it's pretty simple, but hey, we're just starting out. But what the heck... it's a webpage! Congratulations! Give yourself a pat on the back before we go on to the next topic...

More About Text Flags