网络编程
位置:首页>> 网络编程>> 网页设计>> 语义化的HTML与搜索引擎优化(如何编写纯语义的HTML进行搜索引擎优化)(4)

语义化的HTML与搜索引擎优化(如何编写纯语义的HTML进行搜索引擎优化)(4)

作者:Joost.De.Valk 来源:W3CGroup 发布时间:2009-12-28 12:42:00 

标签:搜索引擎,html,语义化

Emphasizing your meaning
强调你要表达的意思

Remember I said earlier that tags should be the emotion of your text? This is where the real emotion comes in: you can provide emphasis to certain words using em or strong. In the old days, people used b and i for that, but these tags are no longer encouraged, since they imply a specific styling, whereas HTML should only describe structure/meaning (all style should be created using CSS, of course.)

还记得我之前说过标签会让你的文字带有情感么?你可以这样:将要强调的字词放在em或strong标签内。在以前,人们常常使用b和i标签来做,但这些标签是不建议使用的,因为,这些标签仅仅是为了实现特别的样式,而HTML要的应该是结构描述和意义(所有的样式应该由CSS来完成。)

Search engines give more weight to any words marked up using any of these four tags. Overusing them can do more harm than good, and actually cause a loss of emphasis, but if treated with care, they can apply an extra dimension to your documents.

搜索引擎会给这四个标签内的文字更高的权重,不过,如果滥用,将弊大于利,而且,反而会影像要强调的内容,但是,如果妥善应用,这会为你的文档增色不少。

A few words on (i)frames
简单讲一下(i)frames

It's quite simple:don't use them.Search engines don't get them,and screenreaders have quite a hard time using them as well.
很简单:别用它们。搜索引擎根本不去抓取它们,而且,屏幕阅读器在读取它们时非常费劲。
 

Conflicts of interest
利与弊

All of the above rules can be bent a little of course, which is a good thing, as sometimes it's necessary to keep everyone at your organization happy. Say your boss wants a page to have a zappy marketing title you'd rather not have, because it doesn't exactly describe what's on the page, and pushes your most important keyword to the second heading. If you're in a competitive area, it might be wise to make the page look like that for your boss, yet use an h2 for the first heading, and an h1 for the second.

以上这些规则多少会感觉有些别扭,然而,好的东西有时候对维持你们单位成员的幸福非常有必要。比如,你老板希望一个页面能有个吸引人的销售标题,而你宁可不要,因为,它不能完全地描述这个页面上的内容,而且这会将你认为最重要的关键词要放在第二个标题内。但是,如果你们行业竞争激烈,你老板那样做是很明智的,页面上还要用一个h2标签放第一个标题,一个h1标签放第二个。

The same goes for iframes and images. If someone really wants you to put a certain block of content on a specific well-ranking page, but you don't want to risk losing focus, you could of course put that content into an iframe or image, and choose not to provide an alternative.

这种矛盾同样适用于iframes和images.如果有人一定要你在一个排名特别好的页面上插入一些打断的内容而你又不想冒降级的风险,你可以选择将这些内容放在一个iframe里或者一张图片里。

These decisions are up to you in the end - normal semantics should be the basis of your design, and the conflicts should only arise when you're really optimizing your pages.

最终的决定在你,正常的语义学应该基于你的设计,而真正的利益冲突会在你真正对自己的页面进行优化时才出现。

Not so simple semantic HTML - Microformats
不那么简单的语义化HTML - 微格式

Microformats are also semantic HTML, but they are not exactly simple! At the moment, search engines are hardly using microformats in their algorithms, but that might change. The hCard especially (the HTML version of the vCard) has some very easy and obvious uses for search engines, and I suspect that they will start using those within the next couple of years. You can apply intelligent extra semantics within Microformats using the basic set of HTML elements - for example, a good way of marking up your address hCard is by using the address tag as a container!

微格式也是语义化的HTML,但是它们却不那么容易。现在,搜索引擎算法还很难理解微格式,但是,这可能会得到改变。hCard(vCard版本的HTML)有很多简单易用的东西针对搜索引擎,我想它们将在随后的数年里使用它们。你可以使用额外的可增强理解的语义化微格式HTML元素,比如,一种好的标识你的地址的hCard会使用address标签来包含。

Conclusion
总结

By using semantic HTML to mark up your pages, you can create pages that are more accessible, both to people with disabilities, as well as to search engines. Good semantic markup helps search engines to determine what the topic of a page is, and if used together with a good site structure, allows you pushy up your web site rankings!

在你的页面上使用语义化HTML,你可以使得它们更易访问,对那些视力障碍的人们和搜索引擎都有好处。好的语义化HTML可以帮助搜索引擎确定页面的主题,如果你同时有一个好的站点结构,这将使得你的网站排名得到提高。

This article is licensed under a Creative Commons Attribution, Non Commercial - Share Alike 2.5 license.

本文采用的授权是创作共用的“署名-非商业性使用-相同方式共享 2.5 通用许可”

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com