CSS3的有什么区别:root伪类和html? [英] What's the difference between CSS3's :root pseudo class and html?

查看:1331
本文介绍了CSS3的有什么区别:root伪类和html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎找不到这方面的更多信息。



Smashing Magazine 似乎基本上说 html :root

解决方案

W3C wiki


:root 伪类表示作为文档根目录的元素。在HTML中,这始终是HTML元素。


CSS是一种通用的样式语言,可以用于其他文档类型,而不仅仅是HTML等SVG。 / p>

规格(强调我的):


此规范定义级联样式表,级别2修订版1(CSS 2.1)。 CSS 2.1是一种样式表语言,允许作者和用户将样式(例如,字体和间距)附加到结构化文档(例如HTML文档和XML应用程序)



Can't seem to find much information about this.

Smashing Magazine seems to essentially say html and :root are the same thing but surely there must be a difference?

解决方案

From the W3C wiki:

The :root pseudo-class represents an element that is the root of the document. In HTML, this is always the HTML element.

CSS is a general purpose styling language that it can be used with other document types, not only with HTML, such as SVG.

From the specification (emphasis mine):

This specification defines Cascading Style Sheets, level 2 revision 1 (CSS 2.1). CSS 2.1 is a style sheet language that allows authors and users to attach style (e.g., fonts and spacing) to structured documents (e.g., HTML documents and XML applications).

这篇关于CSS3的有什么区别:root伪类和html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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