# Next.js: Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p> / In HTML, <p> cannot be a descendant of <p>. This will cause a hydration error

**Code:** `Hydration error: <div> cannot be a descendant of <p>` · **Category:** Next.js · **Seen on:** Next.js, React

The rendered HTML has an invalid element nesting, so the browser "fixes" it and React's hydration no longer matches.

## Meaning

Browsers auto-correct invalid markup (a `<div>` inside `<p>`, `<a>` inside `<a>`, `<tr>` outside `<tbody>`), so the DOM differs from what React rendered on the server. Fix the structure: use `<span>`/`<div>` correctly, don't nest links or paragraphs, wrap table rows in `<tbody>`.

## Common causes

- `<div>` or `<p>` inside a `<p>`
- `<a>` inside `<a>` (Link inside a clickable card)
- `<tr>` without `<tbody>`
- Block elements inside `<button>`
- Markdown/CMS content rendered into a `<p>`

## Quick fix

1. Change the outer `<p>` to a `<div>`
2. Remove nested links/buttons
3. Check the error overlay's component stack for the exact elements

## Detailed fix by platform

### Next.js

1. In dev the overlay prints the nesting path, e.g. `<p> <div>`; fix the first invalid parent

## How to diagnose

1. **Elements** — Which nesting?
2. **Source** — Markdown/CMS?
3. **Table** — tbody present?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/hydration-invalid-html-nesting)
