Web DevelopmentBeginner 1 to 2 hours

Build a Basic CSS/JS Modal Overlay

Create a simple, cleanly styled modal without relying on external UI libraries.

The Scenario

A marketing team wants to add a "Subscribe to Newsletter" pop-up to their blog. The current implementation is just a harsh browser alert(). You need to replace it with a cleanly styled HTML/CSS modal that can be toggled open and closed.

The Brief

Build a basic modal component. It should have a darkened backdrop overlay, a white content box centered on the screen, an "X" button to close it, and a trigger button to open it. Clicking the darkened backdrop should also close the modal.

Deliverables

  • The HTML/JSX structure for the modal and its trigger
  • The CSS (or Tailwind classes) to handle the fixed positioning, z-index, and centering
  • The basic state logic (vanilla JS or React useState) to toggle visibility

Submission Guidance

Focus on getting the CSS right. The backdrop must cover the entire viewport even if the user scrolls, and the modal box must stay centered.

Submit Your Work

Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.

This appears on your public Badge.

0/20000 charactersMarkdown supported

One per line or comma separated. Up to 5 links.

By submitting, you agree your submission text, name, and evaluation will appear on a public Badge URL.