用于内容语言的HTML元标记(HTML meta tag for content language)
以下两个HTML元标记之间有什么区别,用于指定西班牙语网页内容:
<meta name="language" content="Spanish">
和
<meta http-equiv="content-language" content="es">
What is the difference between the following two HTML meta tags, for specifying spanish web page content:
<meta name="language" content="Spanish">
and
<meta http-equiv="content-language" content="es">
最满意答案
<meta name="language" content="Spanish">
在任何规范中都没有定义(包括HTML5草案 )
<meta http-equiv="content-language" content="es">
这是一个可怜的人的版本的一个真正的HTTP标题,应该真的在标题中表达。 例如:
Content-language: es Content-type: text/html;charset=UTF-8
它表示,该文件是面向西班牙语的人士(但这并不意味着该文件用西班牙语写成,例如,它可以用英文写成西班牙语语言课程的一部分)。
从规格 :
Content-Language实体头字段描述了封闭实体的预期受众的自然语言。 请注意,这可能不等于实体中使用的所有语言。
如果您想要说明文件是用西班牙语写的,请使用:
<html lang="es">
<meta name="language" content="Spanish">
This isn't defined in any specification (including the HTML5 draft)
<meta http-equiv="content-language" content="es">
This is a poor man's version of a real HTTP header and should really be expressed in the headers. For example:
Content-language: es Content-type: text/html;charset=UTF-8
It says that the document is intended for Spanish language speakers (it doesn't, however mean the document is written in Spanish; it could, for example, be written in English as part of a language course for Spanish speakers).
The Content-Language entity-header field describes the natural language(s) of the intended audience for the enclosed entity. Note that this might not be equivalent to all the languages used within the entity-body.
If you want to state that a document is written in Spanish then use:
<html lang="es">
相关问答
更多-
Normaly这应该被翻译。 去检查以下几点: 您是否翻译了当前查看的页面 - 或者翻译后备版是否有效? 你是否在typoscript中正确配置了语言? ( config.language , config.sys_language_uid等) 上[FE][pageOverlayFields]列表中的字段不再是? Normaly this should get translated. Go and check the following points: Have you translated the cur ...
-
如何从静态HTML页面读取数据,例如元标记?(How can I read data from my static HTML page, such as the meta tag?)[2021-10-13]
@onetwothree - 如果你只是想访问它的内容,它将是这样的。 export class MyComponent implements OnInit{ private appVersion:string; constructor(){ this.appVersion = ""; } // Runs on component creation ngOnInit(){ this.appVersion = this.getMetaDat ... -
您可以使用正则表达式替换您的html标记。 例如, string myContent = Regex.Replace(description, @"<(.|\n)*?>", string.Empty); 或者 - 你可以使用.Net 4.0+的WebUtility.HtmlDecode和旧版本的HttpUtility.HtmlDecode 。 希望能帮助到你 :) You can use regex to replace your html tags. For example, string myCont ...
-
在任何规范中都没有定义(包括HTML5草案 ) 这是一个可怜的人的版本的一个真正的HTTP标题,应该真的在标题中表达。 例如: Content-language: es Content-type: text/html;charset=UTF-8 它表示,该文件是面向西班牙语的人士(但这并不意味着该文件用西班牙语写成,例如,它可 ...
-
我在我的PHP代码中遇到此错误以显示og文件。 我想,它会在轨道上工作。 你只需将""改成'' 要么 我希望这对你有帮助。 I have ever got this error in my php code to ...
-
你如何检查是否存在使用JavaScript的HTML元标记?(How do you check if a html Meta tag exist using JavaScript?)[2022-03-31]
它将始终返回true,因为querySelectorAll在0匹配的情况下返回一个空数组。 文档 您可以使用NodeList对象的length属性来确定与指定选择器匹配的元素的数量 尝试这个: if (document.querySelectorAll('meta[content="This is not an apple"]').length > 0) { alert('Its here!'); } else { alert('Its not here') } ... -
美丽的汤元内容标签(Beautiful soup meta content tag)[2022-07-25]
soup.find(itemprop="streetAddress").get_text() 您正在获取匹配元素的文本。 相反, 获取“content”属性值 : soup.find(itemprop="streetAddress").get("content") 这是可能的,因为BeautifulSoup提供了一个字典式的界面来标记属性 : 您可以通过将标签视为字典来访问标签的属性。 演示: >>> from bs4 import BeautifulSoup >>> >>> soup = Beautif ... -
不同语言的元标记(Meta tags for different languages)[2021-05-16]
从未使用它,但理论上: Never used it, but in theory: -
HTML 标记(HTML tag)[2022-11-05]
Refresh元标记会自动将浏览器重定向到指定时间后给定的URL。 如果没有看到您正在使用的教程,我无法想象为什么您需要将它用于您的任务。 https://en.wikipedia.org/wiki/Meta_refresh The Refresh meta-tag automatically redirects the browser to the URL given after the specified amount of time. Without seeing the tutorial you a ... -
好的,所有的代码: Document doc = Jsoup.parse("test.html"); Elements metaTags = doc.getElementsByTag("meta"); Example ex = new Example(); for (Element metaTag : metaTags) { String content = metaTag.attr("content"); String name = metaTag.attr("name"); if("d ...