問題描述
我似乎找不到太多關(guān)于此的信息.
I can't seem to find much information about this.
Smashing Magazine 似乎是說 html
和 :root
是同一個(gè)東西,但肯定有細(xì)微的差別嗎?
Smashing Magazine seems to be saying that html
and :root
are the same thing but surely there must be a tiny difference?
推薦答案
來自 W3C 維基:
:root
偽類表示一個(gè)元素,它是文檔的根.在 HTML 中,這始終是 HTML 元素.
The
:root
pseudo-class represents an element that is the root of the document. In HTML, this is always the HTML element.
CSS 是一種通用的樣式語言.它可以與其他文檔類型一起使用,不僅可以與 HTML 一起使用,還可以與 SVG 一起使用.
CSS is a general purpose styling language. It can be used with other document types, not only with HTML, it can be used with SVG for example.
來自規(guī)范(強(qiáng)調(diào)我的):
本規(guī)范定義了層疊樣式表,第 2 級(jí)修訂版 1 (CSS 2.1).CSS 2.1 是一種樣式表語言,允許作者和用戶將樣式(例如字體和間距)附加到結(jié)構(gòu)化文檔(例如 HTML 文檔和 XML 應(yīng)用程序).
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).
這篇關(guān)于CSS3 的 :root 偽類和 html 有什么區(qū)別?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!