Forums

Trying to add CSS counter increment to figure captions (1 post)

  1. corsandy
    Member
    Posted 7 months ago #

    Hi,
    I want to add basic auto counter increment functionality for my figure captions (which are marked up with <figcaption> tags). I added the following CSS code to the style.css file:

    body {
      counter-reset: figure;
    }
    
    figcaption:before {
      content: "Figure " counter(figure) ": ";
      counter-increment: figure;
      font-weight: bold;
    }

    Well it didn't work (no result). Can anyone tell me what's missing? Perhaps WordPress doesn't support CSS counters?

    Thanks

Reply

You must log in to post.

About this Topic