Last active
September 28, 2024 20:46
-
-
Save rubinchyk/58fb48931edd8dd0e2ea44c825ee66a5 to your computer and use it in GitHub Desktop.
[Counters using css] Counter implementation using regular css #css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| body { | |
| counter-reset: section; | |
| } | |
| h2::before { | |
| counter-increment: section; | |
| content: "Section " counter(section) ": "; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Using CSS Counters:</h1> | |
| <h2>HTML Tutorial</h2> | |
| <h2>CSS Tutorial</h2> | |
| <h2>JavaScript Tutorial</h2> | |
| <p><b>Note:</b> IE8 supports these properties only if a !DOCTYPE is specified.</p> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment