Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Newsletter-one

@santosdlaysa

Desktop design screenshot for the Newsletter sign-up form with success message coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Community feedback

Kendpr 290

@RealKendpr

Posted

I checked your code on github and I see that you used margin: auto; to center your .container horizontally, but based on the design you still have to center it vertically.

To do that you can use one of the following: First remove the auto margin then proceed

  1. Absolute positioning You can add this code inside your .container: position: absolute; top: 50%; left: 50%; transfrom: translate(-50%,-50%);
  2. Centering it with grid or do this instead: Make the parent element of your .container (which in your case is body ) a grid: body {display: grid; place-items: center;} Just take note that by using this every sibling of your .container will also be centered, so they might be covered by the other sibling

It should center it both horizontally and vertically

Marked as helpful

0

@santosdlaysa

Posted

Thank you for your help, it was very useful. @RealKendpr

0

Please log in to post a comment

Log in with GitHub
Discord logo

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