What's the difference between html[lang=“en”] and html:lang(en) in CSS?

前端 未结 4 850
借酒劲吻你
借酒劲吻你 2020-11-29 07:21

The CSS language pseudo-class to allow us specify different styles for different languages, like so:

html:lang(en) .foo { ... }

However, th

4条回答
  •  天命终不由人
    2020-11-29 07:55

    One more thing that wasn't mentioned by anybody else - :lang() pseudoclass isn't interested in how one sets the element's language. In XHTML document (true XHTML with XML MIME type), you can use xml:lang="en" and the element will match :lang(en) but not [lang="en"].

提交回复
热议问题