Small, native web tricks worth remembering
htmlcat.net|192 points|50 comments|by marcomezzavilla|Aug 21, 2026
🐱 HTMLcat: A Repository of Essential Native Web Snippets
Welcome to HTMLcat, a curated collection of compact, native web development tricks designed to be remembered and reused.
The site functions as a digital board of "post-its," where each entry follows a specific logic:
🛠️ The Implementation Workflow
Before deploying any of these tricks, ensure you follow this verification process:
- Verify the support label (browser compatibility).
- Implement a reliable fallback mechanism.
- Conduct tests using actual browsers.
- Validate accessibility with assistive technology.
Pro Tip: Native solutions are almost always preferable to heavy libraries if the browser support allows for it.
🗺️ Knowledge Map
The following diagram illustrates how HTMLcat organizes its technical snippets:
📚 The "Post-it" Index
Below is the comprehensive list of native tricks currently archived.
| Category | Feature / Trick | Primary Focus |
|---|---|---|
| JS | Device type | Hardware detection |
| CSS | Hide scrollbars | Visual cleanup |
| CSS | Empty tags | Conditional styling |
| CSS | Centering | Layout alignment |
| CSS | clamp() | Responsive typography/sizing |
| CSS | Smooth scrolling | UX motion |
| CSS | Scroll margin | Anchor positioning |
| JS | classList.toggle() | State switching |
| HTML | Telephone & email links | Direct communication |
| CSS | Text selection highlight | Custom branding |
| CSS | :has() | The relational selector |
| CSS | ::marker | List bullet styling |
| JS | Intl.NumberFormat | Localized currency/prices |
| HTML | inert | Disabling subtree interaction |
| CSS | :target | Fragment-based styling |
| HTML | translate attribute | Internationalization |
| CSS | prefers-color-scheme | Dark/Light mode |
| CSS | Container size queries | Component-based responsiveness |
| HTML | <dialog> element | Native modals |
| CSS | text-wrap | Improved line breaking |
| HTML/CSS | Description list alignment | <dl> layout |
| CSS | accent-color | Native form element branding |
| JS/CSS | Custom Highlight API | Programmatic text highlighting |
| CSS | Hover detection | Input-agnostic hover states |
| CSS | color-mix() | Dynamic color blending |
| JS | Scroll snap events | Intersection/Snap logic |
| Bash | Sort directories by size | File system management |
| CSS | light-dark() | Simplified color pairing |
| CSS | contrast-color() | Automatic accessibility |
| CSS | @scope | Localized CSS scoping |
| CSS | :where() | Zero-specificity selectors |
| CSS | Scroll-driven animations | Motion tied to scroll |
| CSS | Carousels | Native sliding layouts |
| CSS | corner-shape | Non-rectangular borders |
| CSS | Custom functions | Advanced CSS logic |
| CSS | Grid Lanes | Precise grid alignment |
| HTML | Popover API | Transient UI elements |
| JS | View Transitions API | Seamless page morphing |
| CSS | Container style queries | Styling based on parent values |
| HTML | details name | Exclusive accordion behavior |
| HTML | Button commands | Dialog control |
| HTML | hidden=until-found | Searchable collapsed content |
💻 Example Implementation
To give you a taste of these "post-its," here is a look at how a clamp() implementation might look:
/* Responsive font size: Min 1rem, Preferred 5vw, Max 2rem */
.title {
font-size: clamp(1rem, 5vw, 2rem);
}
No post-its found. (All content successfully loaded)