counter-order-display-contents.html (796B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS counter order with "display: contents"</title> 5 <link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com"> 6 <link rel="help" href="https://www.w3.org/TR/css-lists-3/#inheriting-counters"> 7 <link rel="match" href="counter-order-display-contents-ref.html"> 8 </head> 9 10 <body> 11 <style> 12 .counted { 13 counter-increment: section; 14 } 15 16 .counted::before { 17 content: "C=" counter(section) " "; 18 } 19 </style> 20 <div style="display: contents;"> 21 <div class="counted">One</div> 22 </div> 23 <div style="display: contents;"> 24 <div class="counted">Two</div> 25 </div> 26 <div style="display: contents;"> 27 <div class="counted">Three</div> 28 </div> 29 </body> 30 </html>