Design comparison
Solution retrospective
I'm still unsure why the instructions give me two screen size. And i don't know if my solution is "responsive design". But i do limit the content width to 350px so it doesn't go too wide.
And please give example of best practices for this challenge. Thankyou.
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
COMPONENT MEASUREMENTS 📐:
- Use
min-height: 100vh
fordiv
(.centered
) instead ofheight: 100vh
. Setting theheight: 100vh
may result in the component being cut off on smaller screens.
- For example; if we set
height: 100vh
then thediv
will have100vh
height no matter what. Even if the content spans more than100vh
of viewport.
- But if we set
min-height: 100vh
then thediv
will start at100vh
, if the content pushes thediv
beyond100vh
it will continue growing. However if you have content that takes less than100vh
it will still take100vh
in space.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful1@abyanfalahPosted over 1 year ago@0xAbdulKhalid Hi, thank you very much for the feedback!
I didn't know it will be so if i don't set the
min-height
instead. But now i know! Thank you very much.Please also give feedback for my submission upcoming!
0 - @vanzasetiaPosted over 1 year ago
Hi, Yafi Abyan! 👋
The sizes on the
style-guide.md
have nothing to do with the media queries. They are telling you that "this is how your website should look like at these screen sizes". In short, they are just guides.I recommend wrapping the text with semantic HTML elements like a heading and a paragraph element. There should not be text in
<span>
and<div>
alone.I recommend using semantic HTML because of the following reasons.
- It gives tools or assistive technologies such as screen readers the information about the website like the page structure.
- If the CSS fails to load, the browser's user agent stylesheet will get applied. So, the page still makes sense.
Never use
px
unit for font sizes. Userem
orem
instead. Relative units such asrem
andem
can adapt when the users change the browser's font size setting. Learn more — Why you should never use px to set font-size in CSSI recommend making the
<body>
element as the flex container of the card. Then, use the<main>
element as the card. This way, you do not need extra<div>
elements.I hope this helps. Happy coding! 👍
Marked as helpful1@vanzasetiaPosted over 1 year ago@abyanfalah
The card is responsive. 👍
It can shrink on small screen sizes and grow until the specified
max-width
value.If you were using
width
, then the card will not allow to shrink or not responsive.Marked as helpful1@abyanfalahPosted over 1 year ago@vanzasetia Thank you very much for the input. This made me realize i don't know much about creating even a proper HTML page.
I think i'll get into HTML semantics right away. Please also give feedback for my submission in the future.
Thank you very much!
1@abyanfalahPosted over 1 year ago@vanzasetia Thank you for informing me. While i know the concept of responsive design, i'm having difficulty implementing them into code.
Please also give feedback for my submissions upcoming.
Thank you!
1
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