ใช้ CSS :ตัวเลือกรูทเพื่อจัดรูปแบบองค์ประกอบรูทของเอกสาร
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน :root Selector
<!DOCTYPE html>
<html>
<head>
<style>
:root {
background: blue;
color: white;
}
</style>
</head>
<body>
<h1>Heading</h1>
<p>This is demo text.</p>
</body>
</html>