TareaBuild a styled <dialog>. dialog { padding: var(--space-lg); border: none; border-radius: var(--radius-lg); max-width: 400px; box-shadow: var(--shadow-lg); }. dialog::backdrop { background: oklch(0 0 0 / 0.5); backdrop-filter: blur(4px); }. dialog h2 { margin: 0 0 var(--space-md); }. dialog .close { position: absolute; top: var(--space-sm); right: var(--space-sm); background: transparent; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }. Open the dialog via JS on load.
Capstone 6: Componente modal/de diálogo
200 XP14 min
Teoría
Native <dialog> + custom styling
Recap from HTML A2 lesson 10 — <dialog> is the native modal. Here we STYLE it properly:
- Backdrop dimming + blur.
- Centered, with max-width.
- Smooth open animation.
- Close button in the top-right.
🔒
Regístrate para empezar a programar
La teoría está abierta a todos. El editor, la vista previa y el check se desbloquean con una prueba gratis de 7 días — se requiere tarjeta, cancela cuando quieras.
Registrarse — prueba gratis →Las primeras 10 lecciones de cada ruta son gratis. No se necesita tarjeta.