Files
rust_browser/tests/goldens/fixtures/051-child-vs-descendant.html
Zachary D. Rowitsch 2bf8ce6de8 Phase 3: Initial commit
2026-01-31 16:20:53 -05:00

29 lines
660 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
/* Child selector - only matches direct children */
.parent > .direct-child {
background-color: blue;
}
/* Descendant selector - matches any descendant */
.parent .any-descendant {
background-color: green;
}
</style>
</head>
<body>
<div class="parent">
<div class="direct-child">Direct child (should be blue)</div>
<div class="wrapper">
<div class="direct-child">NOT a direct child of .parent (no blue)</div>
</div>
<div class="any-descendant">Direct descendant (green)</div>
<div class="wrapper">
<div class="any-descendant">Nested descendant (also green)</div>
</div>
</div>
</body>
</html>