3-Column Preview Card Component: HTML & CSS only
Design comparison
Solution retrospective
I would love feedback on any or all of the following:
- Organization and readability of the code - could you easily make sense of it if you and I were working on the same team?
- Efficiency of code - could I get the same result with less code?
- Best practices - am I following industry standards and practices that work on different browsers?
- Positive comments - I'll take as many as you want to give me, haha!
- Negative comments - please be gentle, :-0
Thank you for any time you could spend helping me out! Happy new year, Everyone!
Community feedback
- @jguleserianPosted almost 2 years ago
Melvin,
Thank you for the feedback. I tell you, doing these challenges and having feedback from people has been so helpful, especially in respect to accessibility. It also makes me think about things I never questioned or thought to ask about - like setting the <main> to a min-height of 100vh to allow for structures that may expand beyond a viewport - or also like setting and "invisible" <h1> so a screen reader can identify and properly announce the main topic of a page like this one.
Concerning the resetting of the font-size in the <html>, I am in a real quandary since I get conflicting justifications and differing perspectives. On the one hand, there are the reasons stated in the two links you gave. On the other hand, most of these are overcome by resetting the default font size back to 16px, i.e., 1.6rem, in the <body>. Then the browser still acts like it did before but the calculations for rem are easier since rem reflects what was set in the html tag. Then, too, there is no need for endless calculations and long decimals and the extra typing of coding that results from setting variables for every font-size. I found this article interesting just in case you want to see what he has to say:
For me, the eventual use, or non-use, will probably have to conform to whatever my team does if/when I work with one on a future employment. And this, for me, seems to be the biggest argument against the use of a particular "trick" or "hack." Anyway, it's an interesting discussion, and I appreciate you pointing it out because I had taken it for granted that it was an accepted practice, but now I realize that it is not.
Anyway, my Friend, thank you for the advice and comments - they are golden! I'm looking forward to incorporating them into my work on the next project.
Jeff
1@MelvinAguilarPosted almost 2 years ago@jguleserian Sorry for not responding sooner, but you replied to your solution and not to my message, so I didn't receive a notification
It's a very valid opinion, adapted to the workplace
0 - @MelvinAguilarPosted almost 2 years ago
Hi there π. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
HTML:
- You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">3-column preview card component</h1>
- You should use the
<a>
tag instead of the<button>
tag because theLearn More
button is a link to another page. Use buttons to perform actions like submitting a form or closing a modal and use links to navigate to another page. You can read more about this here.
CSS:
- Setting the font-size to 62.5% can attract compatibility issues with third-party libraries or plugins. You can read more about this with this two lectures:
Credit to grace-snow and vanzasetia for pointing this out.
- Use
min-height: 100vh
to thecontainer
selector instead ofheight
. This property lets you set a height and let the element grow even more if necessary.
main { /* width: 100vw; */ /* height: 100vh; */ min-height: 100vh; . . . } @media only screen and (max-width: 375px) main { /* height: 100vh; */ }
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding and Happy New Year! πππ
0 - You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
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