{"id":7096,"date":"2019-12-29T15:59:12","date_gmt":"2019-12-29T14:59:12","guid":{"rendered":"https:\/\/www.creativejuiz.fr\/blog?p=7096"},"modified":"2019-12-29T16:17:05","modified_gmt":"2019-12-29T15:17:05","slug":"custom-counters-in-pure-css","status":"publish","type":"post","link":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css","title":{"rendered":"Custom Counters in pure CSS"},"content":{"rendered":"<p>CSS, since its version 2.1, offers a relatively unknown counter system due to an old incompatibility on IE. Some of you will probably defend the following position: CSS is not made for that, you have to use JavaScript. So be it! But know that it exists, and discover how to use it. Small introduction! <!--more--><\/p>\n<p class=\"message\">This blog post is a translation from the original french article <strong>written in 2012<\/strong>. Keep this history in mind \ud83d\ude42<\/p>\n<p>As I told you, the counters exist and are defined since <a href=\"http:\/\/www.w3.org\/TR\/CSS2\/syndata.html#counter\">CSS2.1 by the W3C<\/a>. The arrival of CSS3 allowed to complete the definition a bit and to include it in a module called &#8220;<a href=\"http:\/\/www.w3.org\/TR\/css3-content\/#counters\">Generated and Replaced Content<\/a>&#8220;.<\/p>\n<p>In this article, we will play with three properties and one function:<\/p>\n<ul>\n<li><code>counter-reset<\/code>: this property allows you to initialize a counter (create it). To do this, you need to fill in one or more counter names followed by its initial numerical value.<br \/>\nExample:<br \/>\n<div class=\"code-embed-wrapper\"> <pre class=\"language-css code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-css code-embed-code\">counter-reset: count1 4 count2 0;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/p>\n<p>Here we&#8217;ve got two initialized counters: <code>count1<\/code> which starts at 4, and <code>count2<\/code> which starts at 0.<\/li>\n<li><code>counter-set<\/code> : this property allows you to redefine the value of a counter, without creating a new one. To do this, fill in one or more existing counter names followed by its new numerical value.<br \/>\nFor example:<br \/>\n<div class=\"code-embed-wrapper\"> <pre class=\"language-css code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-css code-embed-code\">counter-set: count1 0 count2 3;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/p>\n<p>Here we have two counters redefined: <code>count1<\/code> which restarts at 0, and <code>count2<\/code> which restarts at 3.<\/li>\n<li><code>counter-increment<\/code> : this property allows you to increment a counter. To do this, enter the name of one or more counters, each followed by the number to be incremented. Without number following the counter name, the increment will be +1 by default.<br \/>\nFor example:<br \/>\n<div class=\"code-embed-wrapper\"> <pre class=\"language-css code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-css code-embed-code\">counter-increment: count1 2 count2 4;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/p>\n<p>Here our two initial counters will be increased by 2 for count1 and 4 for count2.<\/li>\n<li><code>counter()<\/code>: this function associated with the pseudo-element <code>::before<\/code> or <code>::after<\/code> and the <code>content<\/code> property allows you to insert the counter in your page. This generates a dynamic content. It takes one parameter and a second optional parameter. The first one is the counter name, the second one is the <a href=\"http:\/\/www.w3.org\/TR\/css3-content\/#counter\">counter style<\/a>. (same values as <code>list-style-type<\/code>)<br \/>\nFor example:<div class=\"code-embed-wrapper\"> <pre class=\"language-css code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-css code-embed-code\">li::before {<br\/>\tcontent: counter(count1, decimal-leading-zero) &quot; \u2013 &quot;;<br\/>}<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div><\/p>\n<p>In this example, the content of a <code>li<\/code> element will be preceded by a content type of &#8220;04 -&#8220;.<\/li>\n<\/ul>\n<p class=\"note message\">About the style of the counter, it is possible to specify the values &#8220;disc&#8221;, &#8220;circle&#8221;, &#8220;square&#8221; and &#8220;none&#8221;, so it is possible to generate nothing. I haven&#8217;t found any real use case for these values yet.<\/p>\n<p class=\"important message\">As I write these lines, the <code>counter-set<\/code> property is not recognized by any browsers but Firefox.<\/p>\n<h2>Counter CSS D\u00e9mo<\/h2>\n<p>The simplest way to present those CSS Counters is to give you a well-organized document with a few headings at different levels.<br \/>\nHere is the demonstration:<br \/>\n<a class=\"demonstration\" href=\"\/blog\/doc\/css-counters.html\">CSS Counters Demo<\/a><\/p>\n<p>The code used in HTML is relatively simple: make sure you have <code>h2<\/code>, <code>h3<\/code> and <code>h4<\/code> in a block of text, for example. I give you a snippet if you want to test :<\/p>\n<div class=\"code-embed-wrapper\"> <pre class=\"language-markup code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-markup code-embed-code\">&lt;h2&gt;This is the new way of life&lt;\/h2&gt;<br\/>&lt;p&gt;Lorem ipsum dolor sit amet, [\u2026]&lt;\/p&gt;<br\/><br\/>&lt;h3&gt;Lorem ipsum dolor sit amet, consectetur&lt;\/h3&gt;<br\/><br\/>&lt;h4&gt;Adipisicing elit&lt;\/h4&gt;<br\/>&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing[\u2026]&lt;\/p&gt;<br\/>&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do [\u2026]&lt;\/p&gt;<br\/><br\/>&lt;h4&gt;Anim id est laborum&lt;\/h4&gt;<br\/>&lt;p&gt;Lorem ipsum [\u2026]&lt;\/p&gt;<br\/><br\/>&lt;h3&gt;Reprehenderit in voluptate&lt;\/h3&gt;<br\/>&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore[\u2026]&lt;\/p&gt;<br\/><br\/>&lt;h2&gt;Come back later&lt;\/h2&gt;<br\/>&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore [\u2026]&lt;\/p&gt;<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div>\n<p>The CSS is relatively short when it comes to counters, you just have to pay attention to the details: when counters are initiated and incremented.<\/p>\n<div class=\"code-embed-wrapper\"> <pre class=\"language-css code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-css code-embed-code\">\/* we initiate counters named<br\/>   title2, title3 and title4 *\/<br\/>body {<br\/>\tcounter-reset: title2 title3 title4;<br\/>}<br\/><br\/>\/* we increment value of title2<br\/>   when we meet a h2 *\/<br\/>h2 {<br\/>\tcounter-increment: title2 1;<br\/>}<br\/><br\/>\/* then we generate a content before<br\/>   the element composed by the number<br\/>   in roman letter and un dash symbol *\/<br\/>h2::before {<br\/>\tcontent: counter(title2, upper-roman) &quot; \u2013 &quot;;<br\/>}<br\/><br\/>h3 {<br\/>\tcounter-increment: title3 1;<br\/>}<br\/><br\/>h3::before {<br\/>\tcontent: counter(title3, decimal) &quot; \u2013 &quot;;<br\/>}<br\/><br\/>h4 {<br\/>\tcounter-increment: title4 1;<br\/>}<br\/><br\/>\/* here, we compose the counter<br\/>   the number of the  previous<br\/>   title level, and a letter of<br\/>   the current counter. *\/<br\/>h4::before {<br\/>\tcontent: counter(title3, decimal) &quot;.&quot; counter(title4, lower-alpha) &quot; \u2013 &quot;;<br\/>}<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div>\n<h3>CSS Counters demo on an odered list<\/h3>\n<p>You&#8217;re going to tell me: What&#8217;s the point since the <code>ol<\/code> list is already numbered?<br \/>\nYes, that&#8217;s true, but the use of the generated content allows to apply richer styles thanks to CSS.<br \/>\nAn example in image (and code):<\/p>\n<p class='codepen'  data-height='365' data-theme-id='0' data-slug-hash='abzyRXX' data-default-tab='css,result' data-animations='run' data-editable='' data-embed-version='2'>\n<\/p>\n\n<p>There is a lot of stuff to know about lists, especially <code>ol<\/code> elements. <a href=\"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/html-start-reversed-type-attribute-ol-list-element\">Discover more about attribute start, reversed and type of counters<\/a>.<\/p>\n<p>Don&#8217;t hesitate if you have any question.<\/p>\n<div class=\"sources\">\n<h2>Useful links and sources<\/h2>\n<ul>\n<li><a href=\"http:\/\/dev.w3.org\/csswg\/css3-lists\/#counter-properties\">CSS Counter properties &#8211; CSSWG<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/wiki\/CSS\/Properties\/counter-increment\">W3C Wiki about CSS Counter<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>CSS, since its version 2.1, offers a relatively unknown counter system due to an old incompatibility on IE. Some of you will probably defend the following position: CSS is not made for that, you have to use JavaScript. So be it! But know that it exists, and discover how to use it. Small introduction!<\/p>\n","protected":false},"author":4,"featured_media":7102,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bluesky_dont_syndicate":"","_bluesky_syndication_accounts":"","_bluesky_syndication_text":"","footnotes":""},"categories":[652,647],"tags":[864,807],"coauthors":[597],"class_list":["post-7096","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css3","category-tutorials","tag-counter-en","tag-css-en"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"CSS, since its version 2.1, offers a relatively unknown counter system due to an old incompatibility on IE. Some of you will probably defend the following position: CSS is not made for that, you have to use JavaScript. So be it! But know that it exists, and discover how to use it. Small introduction! This\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Geoffrey Crofte\"\/>\n\t<meta name=\"keywords\" content=\"counter,css,css \/ css3,tutorials\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#article\",\"name\":\"Custom Counters in pure CSS\",\"headline\":\"Custom Counters in pure CSS\",\"author\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/auteur\\\/geoffrey#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/css-counters@2x.png\",\"width\":1980,\"height\":990,\"caption\":\"CSS Counters\"},\"datePublished\":\"2019-12-29T15:59:12+01:00\",\"dateModified\":\"2019-12-29T16:17:05+01:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#webpage\"},\"articleSection\":\"CSS \\\/ CSS3, Tutorials, counter, CSS, CreativeJuiz\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en#listItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/theme\\\/tutorials#listItem\",\"name\":\"Tutorials\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/theme\\\/tutorials#listItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/theme\\\/tutorials\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#listItem\",\"name\":\"Custom Counters in pure CSS\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en#listItem\",\"name\":\"Accueil\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#listItem\",\"position\":3,\"name\":\"Custom Counters in pure CSS\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/theme\\\/tutorials#listItem\",\"name\":\"Tutorials\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/#person\",\"name\":\"Geoffrey Crofte\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c9e2509009badcdf656faf5019ef0f567c4dd4e6e49beca151c21d23995db473?s=96&d=monsterid&r=g\",\"width\":96,\"height\":96,\"caption\":\"Geoffrey Crofte\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/auteur\\\/geoffrey#author\",\"url\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/auteur\\\/geoffrey\",\"name\":\"Geoffrey Crofte\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c9e2509009badcdf656faf5019ef0f567c4dd4e6e49beca151c21d23995db473?s=96&d=monsterid&r=g\",\"width\":96,\"height\":96,\"caption\":\"Geoffrey Crofte\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#webpage\",\"url\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css\",\"name\":\"Custom Counters in pure CSS\",\"description\":\"CSS, since its version 2.1, offers a relatively unknown counter system due to an old incompatibility on IE. Some of you will probably defend the following position: CSS is not made for that, you have to use JavaScript. So be it! But know that it exists, and discover how to use it. Small introduction! This\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/auteur\\\/geoffrey#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/auteur\\\/geoffrey#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/12\\\/css-counters@2x.png\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css\\\/#mainImage\",\"width\":1980,\"height\":990,\"caption\":\"CSS Counters\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/tutorials\\\/custom-counters-in-pure-css#mainImage\"},\"datePublished\":\"2019-12-29T15:59:12+01:00\",\"dateModified\":\"2019-12-29T16:17:05+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/\",\"name\":\"Creative Juiz\",\"description\":\"HTML5, CSS3, JavaScript, WordPress Tutorials\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.creativejuiz.fr\\\/blog\\\/en\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Custom Counters in pure CSS","description":"CSS, since its version 2.1, offers a relatively unknown counter system due to an old incompatibility on IE. Some of you will probably defend the following position: CSS is not made for that, you have to use JavaScript. So be it! But know that it exists, and discover how to use it. Small introduction! This","canonical_url":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css","robots":"max-image-preview:large","keywords":"counter,css,css \/ css3,tutorials","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#article","name":"Custom Counters in pure CSS","headline":"Custom Counters in pure CSS","author":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/auteur\/geoffrey#author"},"publisher":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2019\/12\/css-counters@2x.png","width":1980,"height":990,"caption":"CSS Counters"},"datePublished":"2019-12-29T15:59:12+01:00","dateModified":"2019-12-29T16:17:05+01:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#webpage"},"isPartOf":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#webpage"},"articleSection":"CSS \/ CSS3, Tutorials, counter, CSS, CreativeJuiz"},{"@type":"BreadcrumbList","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en#listItem","position":1,"name":"Accueil","item":"https:\/\/www.creativejuiz.fr\/blog\/en","nextItem":{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/theme\/tutorials#listItem","name":"Tutorials"}},{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/theme\/tutorials#listItem","position":2,"name":"Tutorials","item":"https:\/\/www.creativejuiz.fr\/blog\/en\/theme\/tutorials","nextItem":{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#listItem","name":"Custom Counters in pure CSS"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en#listItem","name":"Accueil"}},{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#listItem","position":3,"name":"Custom Counters in pure CSS","previousItem":{"@type":"ListItem","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/theme\/tutorials#listItem","name":"Tutorials"}}]},{"@type":"Person","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/#person","name":"Geoffrey Crofte","image":{"@type":"ImageObject","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/c9e2509009badcdf656faf5019ef0f567c4dd4e6e49beca151c21d23995db473?s=96&d=monsterid&r=g","width":96,"height":96,"caption":"Geoffrey Crofte"}},{"@type":"Person","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/auteur\/geoffrey#author","url":"https:\/\/www.creativejuiz.fr\/blog\/en\/auteur\/geoffrey","name":"Geoffrey Crofte","image":{"@type":"ImageObject","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/c9e2509009badcdf656faf5019ef0f567c4dd4e6e49beca151c21d23995db473?s=96&d=monsterid&r=g","width":96,"height":96,"caption":"Geoffrey Crofte"}},{"@type":"WebPage","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#webpage","url":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css","name":"Custom Counters in pure CSS","description":"CSS, since its version 2.1, offers a relatively unknown counter system due to an old incompatibility on IE. Some of you will probably defend the following position: CSS is not made for that, you have to use JavaScript. So be it! But know that it exists, and discover how to use it. Small introduction! This","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/#website"},"breadcrumb":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#breadcrumblist"},"author":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/auteur\/geoffrey#author"},"creator":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/auteur\/geoffrey#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2019\/12\/css-counters@2x.png","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css\/#mainImage","width":1980,"height":990,"caption":"CSS Counters"},"primaryImageOfPage":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/tutorials\/custom-counters-in-pure-css#mainImage"},"datePublished":"2019-12-29T15:59:12+01:00","dateModified":"2019-12-29T16:17:05+01:00"},{"@type":"WebSite","@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/#website","url":"https:\/\/www.creativejuiz.fr\/blog\/en\/","name":"Creative Juiz","description":"HTML5, CSS3, JavaScript, WordPress Tutorials","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.creativejuiz.fr\/blog\/en\/#person"}}]}},"aioseo_meta_data":{"post_id":"7096","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-21 17:17:13","updated":"2025-07-09 23:58:06","seo_analyzer_scan_date":null},"_links":{"self":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts\/7096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/comments?post=7096"}],"version-history":[{"count":3,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts\/7096\/revisions"}],"predecessor-version":[{"id":7107,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts\/7096\/revisions\/7107"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/media\/7102"}],"wp:attachment":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/media?parent=7096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/categories?post=7096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/tags?post=7096"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/coauthors?post=7096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}