Check if you can nest one HTML element inside another according to the HTML specification.
Can I Wrap? is a free, instant lookup tool for HTML element nesting rules. Type a child and a parent element, and it tells you whether the nesting is valid, invalid, or context-dependent — with explanations, code examples, and links to MDN.
Data is sourced from the HTML Living Standard and MDN Web Docs.
<div> inside <span> or <a> inside <button>.pnpm install
pnpm dev
Opens the dev server at http://localhost:4321.
pnpm build
pnpm preview
├── public/
│ ├── favicon.svg
│ ├── og-image.png
│ └── robots.txt
├── src/
│ ├── components/
│ │ └── PixelHeart.astro
│ ├── data/
│ │ └── html-nesting.ts # Element definitions and nesting logic
│ ├── layouts/
│ │ └── Layout.astro
│ ├── lib/
│ │ └── sponsors.ts # GitHub Sponsors integration
│ ├── pages/
│ │ └── index.astro
│ ├── scripts/
│ │ └── checker.ts # Client-side nesting checker
│ └── styles/
│ └── global.css
├── astro.config.mjs
└── package.json
This project is inspired by Can I Include? by AJ, a tool that checks whether a given HTML element can be contained within another. Can I Wrap? builds on the same idea with updated data from the current HTML Living Standard, a redesigned interface, and extended nesting logic including content categories and contextual rules.
MIT
Built by midudev.