HTML5< html>属性xmlns,lang,xml:lang [英] HTML5 <html> attributes xmlns, lang, xml:lang
问题描述
我不明白 lang
和 xml:lang
属性的HTML5规范< $ c>< html> 标记。滚动了一下,我的理解是的xmlns
是一个 护身符(没有效果),但对郎是什么
和 xml:lang
?它们应该被使用吗?如果是这样,他们应该设置什么?
I don't understand the HTML5 specifications for the lang
and xml:lang
attributes of the opening <html>
tag. Scrolling up a bit, I understand that xmlns
is a "talisman" (has no effect), but what about lang
and xml:lang
? Should they be used? If so, what should they be set to?
推荐答案
我见过和听到的一切都表明你应该坚持
Everything I've seen and heard suggests that you should stick to
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
(或任何你想要的字符集)。如果您想要与页面关联的语言,您可以在< html>
标记中使用lang属性。
(or whatever character set you actually want). If you want a language associated with the page you can use the "lang" attribute on the <html>
tag.
因为HTML5不是XML,所以我个人觉得使用任何 xml:
命名空间的东西都很奇怪。
Since HTML5 is not XML, really, I personally would find it weird to use any xml:
namespace stuff.
这篇关于HTML5< html>属性xmlns,lang,xml:lang的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!