Design comparison
Solution retrospective
At the start I hat problems of thinking of a way how to even start, then I just started and just tried things out, worked fine, hardest part was centering it so that it would be centered for all devices.
Community feedback
- @denieldenPosted about 2 years ago
Hi Max, congratulations on completing the challenge, great job! π
Some little tips for optimizing your code:
- add
main
tag and wrap the card for improve the Accessibility - use
class
to style the element and not aid
because it must be unique into all the page - use
p
for the text of card instead ofh2
- add descriptive text in the
alt
attribute of the images - centering a
div
withabsolute
positioning is now deprecated, it uses modern css likeflexbox or grid
- use flexbox to the body to center the card. Read here -> best flex guide
Hope this help! Happy coding π
Marked as helpful0@K4zuki-devPosted about 2 years ago@denielden Thank's for the tips, I updated the code now and I fixed the things you told me to, the ID's are gone and replaced with classes, h2 is now a p, and especially the way I aligned it to the center of the site, Flex is waaay easier and it'll be helpful for sure in the future, thanks for your feedback!
1@denieldenPosted about 2 years ago@K4zuki-dev You are welcome and keep it up :)
0 - add
- @nzewiPosted about 2 years ago
Congrats on completing this challenge Max
You have a great solution there. Nice trick you used to center the card
Here are my suggestions:
1.You can use flexbox as well to center the card
body { display: flex; justify-content: center; align-items: center; }
2.Use classes to style your elements to make your styles more reusable.
3.You can use
max-width
instead ofwidth
to make your card more responsive on smaller device widths4.Ensure that all content on your page is contained within a landmark region, e.g Wrapping your box
div
in a<main>
.I hope this helps
Marked as helpful0 - @correlucasPosted about 2 years ago
πΎHi @K4zuki-dev, congratulations on your first solution!π Welcome to the Frontend Mentor Coding Community!
Great solution and a great start! From what I saw youβre on the right track. Iβve few suggestions for you that you can consider adding to your code:
Donβt use
id
to give the style of your elements, it's not a good idea becauseid
is a too specific selector used forforms
and Javascript code. Instead, useclass
for styling and let theid
for much specific stuff. It's also not advisable to use IDs as CSS selectors because if another element in the page uses the same/similar style, you would have to write the same CSS again. Even if you don't have more than one element with that style right now, it might come later.Use a CSS reset to avoid all the problems you can have with the default CSS setup, removing all margins, and making the images easier to work, see the article below where you can copy and paste this CSS code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/
βοΈ I hope this helps you and happy coding!
0@K4zuki-devPosted about 2 years ago@correlucas Hey, i've actually used the exact CSS reset and i've updated some stuff, the ID's are replaced with classes and I now use flex to align the box in the center, it works way better, thanks for your feedback!
1@correlucasPosted about 2 years ago@K4zuki-dev this is really nice then say me if was useful for you and keep posting amazing content π
0
Please log in to post a comment
Log in with GitHubJoin 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