TypechoJoeTheme

Dcr163的博客

统计

CSS3 结构性伪类选择器—root

2017-03-09
/
0 评论
/
1,417 阅读
/
正在检测是否收录...
03/09

    :root选择器,从字面上我们就可以很清楚的理解是根选择器,他的意思就是匹配元素E所在文档的根元素。在HTML文档中,根元素始终是<html>。
    
通过“:root”选择器设置背景颜色

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8">
<title>结构性伪类选择器—root</title>
<style>
    :root{
    background:blue;
    color:#ffd;
}
</style>
</head> 
<body>
<div>Root选择器修改HTML元素的背景颜色</div>
</body>
</html>


朗读
赞(0)
版权属于:

Dcr163的博客

本文链接:

http://dcr163.cn/118.html(转载时请注明本文出处及文章链接)

评论 (0)

人生倒计时

今日已经过去小时
这周已经过去天
本月已经过去天
今年已经过去个月

最新回复

  1. blowjob
    2026-07-19
  2. バイナリー 取引ツール
    2026-07-11
  3. http://www.annunciogratis.net/author/oevsandra54
    2026-05-31
  4. web page
    2026-04-10
  5. plenty of insightful
    2026-03-19

标签云