内容语言的 HTML 元标记 [英] HTML meta tag for content language

查看:21
本文介绍了内容语言的 HTML 元标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下两个 HTML 元标记有什么区别,用于指定西班牙网页内容:

What is the difference between the following two HTML meta tags, for specifying spanish web page content:

<meta name="language" content="Spanish">

<meta http-equiv="content-language" content="es">

推荐答案

<元名称=语言";content=西班牙语">

这没有在任何规范中定义(包括 HTML5 草案)

This isn't defined in any specification (including the HTML5 draft)

这是一个真正的 HTTP 标头的穷人版本,应该在标头中真正表达出来.例如:

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).

来自规范:

Content-Language entity-header 字段描述了封闭实体的目标受众的自然语言.请注意,这可能不等同于实体主体中使用的所有语言.

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">

这篇关于内容语言的 HTML 元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆