什么是css / html`root`元素? [英] What is the css / html `root` element?

查看:199
本文介绍了什么是css / html`root`元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用NetBeans IDE(6.9.1),并使用它来为我的网站添加样式表。

I have just recently started using NetBeans IDE (6.9.1) and have used it to add a stylesheet to my site-in-progress.

我的惊喜,自动添加一个元素:

To my surprise, one element was automatically added:

root { 
    display: block;
}

环顾四周,我可以找到一些关于 :root 伪类,但没有关于 root 元素本身的信息。

Looking around, I could find some information about the :root pseudo-class but nothing about the root element itself.

什么是 root 元素,并且有任何用途吗?

What is the root element and does it have any use?

推荐答案

在HTML中没有元素 。 html元素本身是根元素(这是给予元素的术语,它是文档中所有其他元素的祖先),但这将与 html {}

There is no element called root in HTML. The html element itself is "the root element" (which is the term given to the element which is the ancestor of all the other elements in the document), but this would be matched by html { }.

但是,请参阅 :root 伪类(带冒号)。

However, see the :root pseudo-class (with a colon).

这篇关于什么是css / html`root`元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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