Single price grid commponents (html and css)

Solution retrospective
This is not responsive. Used HTML and CSS. Any kind of suggestions are welcomed.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @MelvinAguilar
Hello there 👋. Good job on completing the challenge !
I have other suggestions about your code that might interest you.
- Wrap the page's whole main content in the
<main>
tag.
- For specificity reasons you should work with classes instead of ids because they are more reusable. You can use ids to work with JavaScript, but you should use classes to style your elements. You can read more about this here 📘.
- The <br> tag is often used to create line breaks, but it doesn't convey any semantic meaning. Use
<ul>
and<li>
for the content under "Why Us": Since the content is a list of items, it's more semantically correct to use an unordered list (<ul>
) and list items (<li>
) instead of using paragraph (<p>
).
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
Marked as helpful - Wrap the page's whole main content in the
- @joshmichael23
Great job on your project. You can make it better by using the font given in the style-guide.md.
What I usually do is go to fonts.google.com then search for the font. Add the necessary font-weights by clicking on the + and then click the cart on the top right. You can then use the
<link>
or the@import
under the Use on the web section depending on your preference. Hope it helps :)Marked as helpful - P@danielmrz-dev
Hello @rajendra2708578!
Your project looks great!
I noticed that you used
position
to place the card in the middle of the page. Here's two very efficient ways to center the card:- You can apply this to the body (in order to work properly, you can't use position or margins):
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
- Or you can apply this to the element you wanna center (works well with projects with only one centered element, like this one):
.element { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
Other details to improve your project and make it look even closer to the original design:
- Check the
style-guide
file to check what's the recommendedfont-family
for the project. - Add a
border-radius
to thediv#card
. Something likeborder-radius: 6px; overflow: hidden;
is enough; - Instead of using
div
for the main content, usemain
. It won't change anything visually but it makes your HTML code more semantic and improves SEO optimization and acessibility.
I hope it helps!
Other than those details, your solution is great!
Happy New Year 😊
Marked as helpful
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