Skip to content

Commit 6d62d08

Browse files
committed
chore: add example for 'contain: style'
1 parent 8ac6c3c commit 6d62d08

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

contain/contain-style.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Float interference</title>
6+
<style>
7+
body {
8+
counter-reset: headings;
9+
}
10+
11+
h1::before {
12+
counter-increment: headings;
13+
content: counter(headings) ": ";
14+
}
15+
16+
.contain {
17+
contain: style;
18+
}
19+
</style>
20+
</head>
21+
<body>
22+
<h1>Introduction</h1>
23+
<h1>Background</h1>
24+
<div class="contain">
25+
<h1>Contained counter</h1>
26+
</div>
27+
<h1>Conclusion</h1>
28+
</body>
29+
</html>

0 commit comments

Comments
 (0)