counter-scoping-002.html (845B)
1 <!doctype html> 2 <html lang=en> 3 <meta charset=utf-8> 4 <title>CSS-contain test: style containment and counter-set</title> 5 <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net"> 6 <meta name=flags content=""> 7 <meta name=assert content="counter-set is scoped to the subtree and creates a new counter at the root of the subtree"> 8 <link rel="match" href="reference/counter-scoping-001-ref.html"> 9 <link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-style"> 10 <link rel=help href="https://drafts.csswg.org/css-lists-3/#propdef-counter-set"> 11 12 <style> 13 div { 14 contain: style; 15 counter-set: n 1; 16 } 17 div::before, div::after { 18 content: counters(n, '.') " "; 19 } 20 div::after { 21 counter-set: n 2; 22 } 23 </style> 24 25 <p>Test passes if the text below is "1 1.2" (not including the quotation marks).<p> 26 <div></div>