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

Single price grid component

backpackoderβ€’ 80

@MrFougasse

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I still don't know how to center the div vertically [UPDATED]. But anyway everything seems good and responsive. I don't get why the "up" word of the "sign up" text into the button go to a new line when we use the zoom around less 1300px.

Community feedback

Davidβ€’ 8,000

@DavidMorgade

Posted

Hello Harderth, congrats on finishing the challenge!

If you want to center your div vertically and horizontally at the same time, instead of using margins on your div, try using flex-box in the parent element (the body), to archive this you have to set the min-height of your body to 100vh, with this it will take the full space of the screen, meaning that you can center the elements inside it with flexbox like this:

body {
  font-family: 'Karla', sans-serif;
  font-size: 16px;
  background-color: hsl(204, 43%, 93%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
}

I encourage you to try it in your solution and see if it works!

Hope my feedback helps you, if you have any questions don't hesitate to ask, goog job!

Marked as helpful

1
imadβ€’ 3,310

@imadbg01

Posted

Greeting harderth!! Congratulations for completing Your challenge, πŸ‘πŸ‘πŸ‘ well done.

you can center the div perfectly on middle of the page by using flex and body as a reference, first give the body min-height: 100vh; to fill browser screen size, and apply flex portieres to it.

-fix example.


body {
	
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

Hope this help!

happy Codding, Have a Good Day/Night

Marked as helpful

1

backpackoderβ€’ 80

@MrFougasse

Posted

Thank you so much @DavidMorgade and @imadbg01 for your advices! What do you mean by "fix snippet" @imadbg01 ?

1
Davidβ€’ 8,000

@DavidMorgade

Posted

@MrFougasse Hello man, the 'snippet' is the piece of code he posted, usually snippet are pieces of code that you need to use over and over in different projects, you usually config your code editor with shortcuts to write this snippets for you faster.

2
backpackoderβ€’ 80

@MrFougasse

Posted

@DavidMorgade Got it, yes I just modified the code, so now we should see the grid in the middle of the screen

1
imadβ€’ 3,310

@imadbg01

Posted

@DavidMorgade Thank You David for clarifying I appreciate it, I was thinking of a fix example.

1
Bandaru Sindhujaβ€’ 190

@SindhujaBandaru

Posted

**Hello MrFougasse Congratulations on completing your new project πŸ‘ ** I can't see the code for this site please share the link. And for the button to center the whole text useπŸ‘‡ display: flex; text-align:center; justify-content:center; align-items:center; max-width:100%; Happy CodingπŸ₯³πŸ₯³

1

backpackoderβ€’ 80

@MrFougasse

Posted

@SindhujaBandaru I think here it is :

https://github.com/MrFougasse/challenges-frontend-mentor/blob/Single-price-grid-component/index.html

(I am very new to GitHub so I don't really get how it works)

0
Bandaru Sindhujaβ€’ 190

@SindhujaBandaru

Posted

@MrFougasse No problem.Thank you

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