Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 6 months ago

Newsletter sign-up form (HTML + CSS + JS vanilla)

P
Antoine•330
@super7ramp
A solution to the Newsletter sign-up form with success message challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I think implementation is pretty close to the Figma design and works as expected.

What challenges did you encounter, and how did you overcome them?

Essentially styling the <dialog> element.

By default, <dialog> has a display: none and switches to display: block when opened. I wanted to customize the dialog and use a display: flex, but only when dialog is open. I had to use for the first time an attribute selector for that, otherwise dialog would appear by default on the page:

.success-dialog[open] {
   display: flex
   /* ... */
}

Also, dialog is centered by default but after my CSS reset, it wasn't anymore. Had to use margin: auto to fix that. Maybe my CSS reset could be improved.

What specific areas of your project would you like help with?

Any feedback/advice welcome!

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Antoine's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License