Responsive 3-Column Preview Cards using Vanilla CSS and HTML
Design comparison
Solution retrospective
Any suggestions for how to improve my code are greatly appreciated! I apologize for not having any specific questions; it's late and my brain worked just long enough to get this finished before shutting down entirely.
Community feedback
- @VCaramesPosted almost 2 years ago
Hey there! 👋 Here are some suggestions to help improve your code:
- The headings in your component are being used incorrectly❌. Since the
h1
heading can only be used once ⚠️, it is always given to the heading with the highest level of importance. This component has three headings of equal importance, so the best option would be to use anh2
heading ✅ since it is reusable and it will give each heading the same level of importance.
- Your "buttons" were created with the incorrect element ❌. When the user clicks on the button they should be directed to a different part of you site. The
anchor tag
will achieve this.
More Info:📚
- ALWAYS Implement a "Mobile First" approach 📱 > 🖥
Mobile devices are now the dominant 👑 way in which people browse the web. So when building your content, you will start building with small screen sizes (starting at 320px) and work your way to larger screens using
min-width
.More Info: 📚
If you have any questions or need further clarification, you can always check out my submission and/or feel free to reach out to me.
Happy Coding! 👾
Marked as helpful0@KoiHastPosted almost 2 years ago@vcarames thank you for your help! I actually originally had them as h2 headings, but the html report when I posted it said it required a h1 heading, and since those were the only headings on the page, I changed them.
Also, wouldn’t the anchor tag go within the button element? I’m not trying to argue, I just genuinely don’t know. Wouldn’t you make a button element with a link inside it to link to another page?
1@VCaramesPosted almost 2 years ago@KoiHast
Glad I could help!
Unfortunately, the report is not aware that this challenge is a component and not a full site. So it will always throw that error. But if you wish to get rid of it, you can always add a "visually hidden"
h1
heading.Do not ever feel like you are arguing by asking questions. That is how we learn.
There are two ways of creating "buttons" (they cannot be combined)
button
which are for actions; submitting forms, adding items to your card, etc..anchor
which allows you to navigate to either internal or external content, download content, etc..
What makes the
anchor
element special is that it has a specialattribute
, thehref
, which allows you to enter a link.Hopefully this clarifies things.
Marked as helpful1@KoiHastPosted almost 2 years ago@vcarames Thank you! I took a peek at your solution to see how you did it, and that totally makes sense now. I thought you had to use a button element for anything that, well, looks like a button. I never realized you could just style an anchor tag to look like a button!
Thanks again for your help!
1 - The headings in your component are being used incorrectly❌. Since the
- @MouradisPosted almost 2 years ago
the quick advice i can give you is that you made your media query too early about 900px you should but it about max-width : 480px (mobile size) or if you want 780px (tablets size)
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