在html5 html标记中不使用lang属性的后果 [英] Consequences of not using a lang attribute in an html5 html tag

查看:298
本文介绍了在html5 html标记中不使用lang属性的后果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在我的html5文档的开头,我简单地使用:

<!DOCTYPE html>< html>

我的网站如何处于不利的状态:

<!DOCTYPE html>< html lang =en>

解决方案

好的问题,但我想大部分你想知道的是简单的参考:

http://www.w3.org/TR/html4/struct/dirlang.html



一些亮点:$ b​​
$ b


通过
lang属性指定的语言信息可以被用户
代理使用控制以
种方式进行渲染。
作者提供的语言信息
可能有帮助的一些情况包括:


  • 协助搜索引擎

  • 帮助语音合成器

  • 帮助用户代理选择高品质字体的字形变体

  • 帮助用户代理选择一个集合
  • 帮助用户代理作出关于连字符,
    连字符和间距的决定

  • 协助拼写检查器和语法检查器
  • li>

我不相信HTML4和HTML5在这方面有任何重要的区别。


If at the start of my html5 doc I simply use:

<!DOCTYPE html><html>

how will my site be at a disadvantage for not using something like:

<!DOCTYPE html><html lang="en">

解决方案

Good question, but I think most of what you want to know is simple reference:

http://www.w3.org/TR/html4/struct/dirlang.html

Some highlights:

Language information specified via the lang attribute may be used by a user agent to control rendering in a variety of ways. Some situations where author-supplied language information may be helpful include:

  • Assisting search engines
  • Assisting speech synthesizers
  • Helping a user agent select glyph variants for high quality typography
  • Helping a user agent choose a set of quotation marks
  • Helping a user agent make decisions about hyphenation, ligatures, and spacing
  • Assisting spell checkers and grammar checkers

I don't believe there are any important differences between HTML4 and HTML5 regarding this.

这篇关于在html5 html标记中不使用lang属性的后果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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