尝试将 CSS 计数器增量添加到 WordPress 博客中的图形标题
我想向 WordPress 博客中的图形标题(用
body {
counter-reset: figure;
}
figcaption:before {
content: "Figure " counter(figure) ": ";
counter-increment: figure;
font-weight: bold;
}
好吧,它不起作用(没有添加生成的内容)。任何熟悉 WordPress 的人都可以告诉我缺少什么吗?我在常规网页上测试了这段代码,效果很好。也许 WordPress 不支持 CSS 计数器?
谢谢
I want to add basic auto counter functionality to my figure captions (which are marked up with <figcaption> tags) in a WordPress blog. So 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 generated content was added). Can anyone familiar with WordPress tell me what's missing? I tested this code on a regular webpage and it works fine. Perhaps WordPress doesn't support CSS counters?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论