且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SEO:<按钮和GT; VS< A> HTML标签

更新时间:2022-11-30 11:57:27

SEO明智的,***是使用<因为搜索引擎不标记; A&GT通过按键输入也没有,而是寻找锚标记及其属性(HREF,标题)。所以,如果你链接到另一个网页,其中需要通过搜索引擎,它更有意义无论对于搜索引擎优化,并与问候语义使用锚标记被抓取的网站上。

SEO-wise it is best to use the <a> tag since search engines don't go through buttons nor input but rather look for anchor tags and their attributes (href, title). So if you're linking to another page on the website which needs to be crawled by search engines it makes more sense both for SEO and with regards to semantics to use an anchor tag.

在另一方面,如果你正在构建一种形式,它使得使用&LT更有意义;按钮&GT; &LT;输入&GT ; 在这种情况下,你应该遵循的文档中的建议

On the other hand if you're building a form, it makes much more sense to use the <button> or <input> and in this case, you should follow the recommendation in the documentation.

我相信文档中引用实际上应该说:

I believe the reference in the documentation should actually say:

[...]推荐使用元素的而不是输入
  元素
尽可能[...]

[...] recommend using the element instead of the input element whenever possible [...]

另外请注意,大多数表单元素,包括&LT;输入&GT; &LT;按钮&GT; 有浏览器的特定风格,有时难以/不可能改变没有JavaScript的Twitter的引导文件中,因此这条评论。

Also note that most form elements including <input> and <button> have browser specific styles that are sometimes hard/impossible to change without JavaScript hence this comment in the Twitter Bootstrap documentation.