What can <META> Do for You?




The other day somebody asked me, "What's a <meta> tag?"

"Meta," I thought, "that rhymes with feta." And that got me thinking about cheese.

Childhood, as far as your basic cheese selections go, was easy. In your typical middle-class family, you had one of three choices: cheddar, Monterey Jack, and those precious, flat, sandwich-sized slices of American. That's what all the cool kids ate. I had to fight my mother to get those into my lunch. She used to make sandwiches with these huge slabs of cheddar cheese that looked like they were hewed from the side of an orange glacier. Although I lost the Wonder Bread battle, I didn't give an inch on this one. For some reason, Mom couldn't see the simple beauty in a perfectly proportioned square of processed cheese food.

The problem with childhood is that we never appreciate it while we have the chance. As I grew up, I developed more mature needs and tastes. Like many young adults lost in the hype of '80s mass cultural wonders like Molly Ringwald and Oingo Boingo, I began to experiment. I told myself that I didn't have a problem, but a little brie here, and a bit of Chaumont there, and before I knew it, I was hooked.

My problems aside, cheese took a serious hit in the early '90s. Cheese, it was discovered, is composed mostly of fat. It's "bad" for you. Less fattening cheeses like feta became all the rage. Feta, if you're unaware, originated in Greece and has been made the same way for thousands of years. Now, aside from the fact that "feta" and "meta" rhyme and share common Greek etymologies, there is absolutely no correlation between the two. You can't eat a <meta> tag, which - frankly - makes it a lot less interesting.

So what is it? Glad you asked. The <meta> tag is often found at the top of an HTML document between the </title> and the </head> tag. It has a variety of uses, but one of the most common is the client-pull function, used to either reload or redirect pages after a specified amount of time. The reload function is relatively simple, and the syntax looks like this:

<meta http-equiv="Refresh" content="30">
Let's break this down. http-equiv gives the name of the http function that you want parsed by the server and content is the amount of time you want to wait before the server goes ahead with the http-equiv. In this case, we're waiting 30 seconds before reloading.

If you want to redirect users to another page, you would add a URL to the tag syntax to tell the server where it should go.

<meta http-equiv="refresh" content="30; URL=http://www.hotwired.com/frontdoor/index.html">
In this case, when 30 seconds have expired, we're redirected to a new page, which is defined by the URL attribute in the tag.

The <meta> tag can also be used to convey information about your document that can't be found anywhere within it. A lot of people use it to add keywords to their pages - which helps control how the page is indexed by search engines.

To do this, you need the name element to - what else - give the information a name. This might sound a little silly at first, but if you use the <meta> tag several times in one document to do many different things, it's important to keep the tags straight - otherwise you might have trouble remembering what each one does. The content attribute also differs here. Rather than assigning a refresh time, you use this space to add the keywords:

<meta name="keywords" content="chicken, biscuits, cheese">
In the above example, your document will be referenced by the additional keywords chicken, biscuit, and cheese - even if the only thing on your page is a giant JPEG of your favorite NASCAR driver. Of course, this isn't very helpful to your readers, so try to use words that relate to your content.

The uses for the <meta> tag are continuously expanding, so when I figure out more, I'll let you know. Oh, and if you're selecting fine cheeses, I recommend a nice havarti. Although it's from Scandinavia - which isn't known for its fine cheeses - havarti's quite delicious.