• Aucun résultat trouvé

Adding body text

Dans le document Search Engine (Page 118-121)

You need text in your page. How much? More than a little, but not too much.

Maybe 100 to 250 words are good. Don’t get too hung up on these numbers, though. If you put an article in a page, and the article is 1,000 words, that’s fine. But in general, something in the 100–250 word range is good.

That amount of content allows you to really define what the page is about and will help the search engine understand what the page is about.

Figure 5-5:

This entire page is invisible to the search engines. It’s made up of one large image and a JavaScript navigation tool.

Keep in mind that a Web site needs content in order to be noticed by the search engines. (For more on this topic, see Chapter 2.) If the site doesn’t have much content for the search engine to read, the search engine will have trouble determining what the page is about and may not properly rank it. In effect, the page loses points in the contest for search engine ranking. Certainly keywords in content are not all there is to being ranked in the search engines; as you find out in Chapters 12 and 13, for instance, linking to the pages is also very impor­

tant. But keywords in content are very significant, so the search engines have a natural bias toward Web sites with a large amount of content.

This bias toward content could be considered to be very unfair. After all, your site may be the perfect fit for a particular keyword search, even if you don’t have much content in your site. In fact, inappropriate sites often appear in searches simply because they have a lot of pages, some of which have the right keywords.

Suppose that your Rodent Racing Web site is the only site in the world at which you can buy tickets for rodent-racing events. Your site doesn’t provide a lot of content because rodent-racing fans simply want to be able to buy the tickets. However, because your site has less content than other sites, it is at a disadvantage to sites that have lots of content related to rodent racing, even if these other sites are not directly related to the subject.

You really can’t do much to confront this problem, except to add more con­

tent! (Try to get into a habit of adding one page of quality content per day to your site.) You can find some ideas on where to get content in Chapter 8.

Creating headers: CSS vs. <H> tags

Back when the Web began, Web browsers defined what Web pages looked like.

A designer could say, “I want body text here, and a heading there, and an address over there,” but the designer had no way to define what the page actually looked like. The browser decided. The browser defined what a header looked like, what body text looked like, and so on. The page might appear one way in one browser program, and another way in a different program.

These days, designers have a great new tool available to them: Cascading Style Sheets (CSS). With CSS, designers can define exactly what each element should look like on a page.

Now, here’s the problem. HTML has several tags that define headers: <H1>,

<H2>, <H3>, and so on. These headers are useful in search engine optimization, because when you put keywords into a heading, you’re saying to a search engine, “These keywords are so important that they appear in my heading text.” Search engines pay more attention to them, weighing them more heavily than keywords in body text.

But many designers have given up on using the <H> tags and rely solely on CSS to make headers look the way they want them to. The plain <H> tags are often rather ugly when displayed in browsers, so designers don’t like to use them. <H> tags also cause spacing issues; for example, an <H1> tag always includes a space above and below the text contained in the tag.

However, there’s no reason why you can’t use both <H> tags and Cascading Style Sheets. You can use style sheets two basic ways:

Create a style class and then assign that class to the text you want to format.

Define the style for a particular HTML tag.

Many designers do the former; they create a style class in the style sheet, like in the following example:

.headtext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color:

#3D3D3D }

Then they assign the style class to a piece of text like this:

<DIV CLASS=”headtext”>Rodent Racing for the New Millennium!</div>

In this example, the headtext class makes the text appear the way that the designer wants the headings to appear. But as far as the search engines are concerned, this is just normal body text.

A better way is to define the <H> tags in the style sheets, as in the following example:

H1 {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 16px;

font-weight: bold;

color: #3D3D3D }

Now, whenever you add an <H1> tag to your pages, the browser reads the style sheet and knows exactly what font family, size, weight, and color you want. It’s the best of both worlds — you get the appearance you want, and the search engines know it’s an <H1> tag.

Dans le document Search Engine (Page 118-121)

Documents relatifs