Html <meta name="title"> 标签和 <title></title> 标签的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21076201/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between <meta name="title"> tag and <title></title> tag
提问by Rajasekhar
Please clarify what is the difference between <meta name="title">
tag and <title></title>
tag.
请澄清<meta name="title">
标签和<title></title>
标签之间的区别是什么。
<title>Page title</title>
<meta name="title" content="Page title">
If both are used which is most prioritised?
如果两者都使用,哪个最优先?
I observed some sites both meta tag title and <title></title>
tags both are same,which is expected, please confirm?
我观察到一些网站的元标签标题和<title></title>
标签都相同,这是预期的,请确认?
If we didn't use <meta>
tag title would I have any problem regarding SEO?
如果我们不使用<meta>
标签标题,我会对 SEO 有什么问题吗?
<head>
<title>Stackoverflow</title>
<meta name="description" content="free source">
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
</head>
回答by ajp15243
<title>
is a required element on any HTML page to be valid markup, and will be what is displayed as the page title in your browser's tab/window title. For instance, try inputting the following markup into the W3C Markup Validator(via "Direct Input"):
<title>
是任何 HTML 页面上的必需元素,才能成为有效标记,并且将显示为浏览器选项卡/窗口标题中的页面标题。例如,尝试将以下标记输入W3C 标记验证器(通过“直接输入”):
<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>
This will produce an error that there is no instance of <title>
in <head>
.
这将产生没有<title>
in实例的错误<head>
。
The <meta name="title" content="page-title">
element is just that -- metadata about your page, that any client browser or web crawler can use or not use as it wants. Whether it is used or not will depend on the crawler/client in question, as none of them are required to look for or not look for it.
该<meta name="title" content="page-title">
元素就是这样-你的网页的元数据,任何客户端浏览器或网络爬虫可以使用或就是了不得使用。是否使用它取决于所涉及的爬虫/客户端,因为它们都不需要寻找或不寻找它。
So in short, you should have a <title>
element if you want valid markup. The <meta>
tag is going to depend on whether you want to provide for crawlers/clients, and you'd probably have to check documentation for if a particular crawler uses it.
所以简而言之,<title>
如果你想要有效的标记,你应该有一个元素。该<meta>
标签将取决于您是否要为爬虫/客户端提供,并且您可能必须检查文档以了解特定爬虫是否使用它。
回答by Ranveer
The first is to display page name.
首先是显示页面名称。
<title> This will be displayed in the title bar of your Browser. </title>
Second is for crawling.
二是用于爬行。
<meta name="title" content="Whatever you type in here will be displayed on search engines.">
回答by mjkaufer
The <title>
tag will actually display the page name at the top of the page. The <meta>
tag, while used for crawling, could be omitted and the page still should crawl over the <title>
tag. I think you could just stick with the <title>
tag if you wanted.
该<title>
标签实际上会在页面顶部显示页面名称。<meta>
用于抓取的标记可以省略,页面仍应抓取<title>
标记。如果你愿意,我认为你可以坚持使用<title>
标签。
回答by Norbert Norbertson
I have noticed that for some blog sites google will use
我注意到对于一些博客网站,谷歌会使用
<meta name="description"
for a general description of the site.
网站的一般描述。
So, if you have a blog site where the home page also shows the latest blog post you don't want the site description to be the same as the blog post name defined in
因此,如果您有一个博客站点,其中主页还显示最新的博客文章,您不希望站点描述与定义的博客文章名称相同
So I'd try meta description for an overview and
所以我会尝试元描述的概述和
<title>
for specific content.
为具体内容。