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

MrNomisā€¢ 40

@MrNomis

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


So this is just a beginners Project but iĀ“m still not quite sure how to center something properly. In my desktop Version i hat to work with marings to center it horizontally which i think is not the best option for different screen sizes.....

so if anyone can help me with that would be appreciated.

Community feedback

T
Chamuā€¢ 13,110

@ChamuMutezva

Posted

Greetings MrNomis

So far so good šŸ™Œ. Here are a few of my observation.

  • Elements such as header, main, footer have semantic meaning other than elements such as section, div, span. The main element is important in a site as it contains the main purpose of the site.
  • an h1 element should be the first heading of your site in most cases .
  • in .section-three , i would suggest the p element to an unordered list
  • using fixed widths and heights on your elements can cause your elements to behave strangely when the contents of the element cannot fit in the container. Let the contents decide on the height without restrictions.
  • to center the container , make .container to have a min-height: 100vh and justify-content: center as well
  • for font sizes . use rems

Marked as helpful

0

MrNomisā€¢ 40

@MrNomis

Posted

@ChamuMutezva that is actually really helpfull mate. thank you

0
IRVINE MESAā€¢ 1,855

@DrMESAZIM

Posted

Hi MrNomis I had time to look into your silution in particular about centering everything better at the center . Here are the changes are applied on the style.css file

  1. remove all of line 22

2.Replace line 142-144 with this code

.container { height: 100vh;

}
  1. Remove this "position: fixed" line 127
0
Abdulā€¢ 8,540

@Samadeen

Posted

Hey MrNomis!! Cheers šŸ„‚ on completing this challenge.. .

Here are my suggestions 1.You should use <main class="container"> instead of <div class="container">. 2. Go down orderly when you are using the headings h1 down to h2 down to h3 and so on. 3. You can use the margin property to center your card and maybe reduce the width a little bit eg: margin: 10rem auto;. Or you can set display to flex then set both align-items and justify-content to center. this will center a div both horizontally and vertically.

Regardless you did amazing... hope you find this useful... Happy coding!!!

0

@Oluwafemi21

Posted

To center things there are several ways. But the best two I can recommend is using flex and grid. The code for using flex goes thus display:flex; align-items:center; and justify-content:center; this would be the styling of the body element, since you want to center all your items in the middle of the page. same goes for the grid property display:grid; place-items:center; and if you haven't learnt either flex or grid i implore you to learn it.

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