What is the HTML5 alternative to the obsolete meta http-equiv=content-language.

前端 未结 2 558
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 07:30

I\'m finishing up an HTML5 site that has a mixture of English and Mandarin Chinese.

My validator (HTML5 Validator add-on for FF) is giving me this error:

<         


        
相关标签:
2条回答
  • 2020-12-17 08:13

    In HTML5 you can actually define lang for each element. That means if you have a div that contains Mandarin Chinese in it, just define an attribute lang="zh-CN" for that div, like <div lang="zh-CN">.

    0 讨论(0)
  • 2020-12-17 08:16

    See below for language and charset settings

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>title</title>
    .....
    
    0 讨论(0)
提交回复
热议问题