The element name is
, the name attribute indicates the type of meta element it is, and the content attribute supplies the relevant information.
Meta elements don’t show up when your page appears in a browser. They’re intended for programs, like browsers and web search engines (see the box below), that read your web page from top to bottom.
In theory, there’s no limit to the types of information you can put inside a meta element. For example, some web page editing programs insert meta elements that say its software built your pages (don’t worry; once you understand meta elements, you’ll recognize this harmless fingerprint and you can easily remove it). Another web page might use a meta element to record the name of the web designers who created it, or the last time you updated the page.
Some meta elements are more important than others, because search engines heed them. In the following sections, you’ll learn about two of these: the description and keywords meta elements. These details, in conjunction with the
element, constitute the basic information that a search engine needs to gather about your page.
UP TO SPEED
How Web Search Engines Work
A Web search engine like Google has three pieces. The first is an automated program that roams the Web, downloading everything it finds. This program (often known by more picturesque names like spider , robot , or crawler ) eventually stumbles across your website and copies its contents.
The second piece is an indexer that chews through Web pages and extracts a bunch of meaningful information, including a Web page’s title, description, and keywords. The indexer also records a great deal of more esoteric data. For example, a search engine like Google keeps track of the words that crop up the most often on a page, what other sites link to your page, and so on. The indexer inserts all this digested information into a giant catalog (technically called a database ).
The final piece of the search engine is the part you’re probably most familiar with—the front-end, or search page. You enter the keywords you’re hunting for, and the search engine scans its catalog looking for suitable pages. Different engines have different ways of ranking pages, but the basic idea is that the search engine attempts to make sure the most relevant and popular pages turn up early in the search results. A search engine like Google doesn’t rank websites individually. That is, there’s no such thing as the world’s most popular Web page (in the eyes of Google). Instead, Google ranks pages in terms of how they stack up against whatever search keywords a visitor enters. That means that a slightly different search (say, “green tea health” instead of just “green tea”) could get you a completely different set of results.
The Description Meta Element
The description of your page is probably the easiest meta element to come up with. You simply write a few sentences that distill the content of your site into a few plain phrases. Here’s an example:
Although you can stuff a lot of information into your description, it’s a good idea to limit it to a couple of focused sentences that total no more than around 50 words. Some search engines home in on the description text, while others rely more heavily on the text in the page. Even if your description appears on a search results page, readers see only the first part of it, followed by an ellipsis (…) where it gets cut off.
Tip: The description meta element gives search engines some key information. You should include it in every page you create.
The Keyword Meta Element
Your keyword meta element should contain a list of about 25 words or phrases that represent your website. Separate each word in the list by a comma. Here’s an example: