实例首页
自学教程
IT工具箱
源代码
下载代码
上下布局
点击运行 >
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>CSS counter() 函数 实例 - 自学教程(runoops.com)</title> <style> body { counter-reset: section; /* 重置计数器成0 */ } h3:before { counter-increment: section; /* 增加计数器值 */ content: "Section " counter(section, upper-roman) ": "; /* 显示计数器 */ } </style> </head> <body> <h1>使用 CSS 计数器:</h1> <h3>GOOGLE</h3> <h3>RUNOOPS</h3> <h3>TAOBAO</h3> </body> </html>
运行结果: