Design comparison
Solution retrospective
I'm proud that I was able to finish this project without loking at YouTube tutorial.
What challenges did you encounter, and how did you overcome them?The challenges that I encountered were css widths, heights. As I overcame them, I began to understand it more.
What specific areas of your project would you like help with?The areas that I would like help with is css widths, heights and learning how to structure your project in HTML.
Community feedback
- @dmolthuPosted 8 months ago
Hello, I thought you did a great job on this project, it looks pretty much identical to the sample and it's just about the same size too.
I noticed in your code that you made the learning button interactable by hovering over it and being able to click it which I thought was a nice addition.
Code looks good too overall great job.
Marked as helpful0 - @grace-snowPosted 8 months ago
Hi, here is some feedback as requested, I hope it helps.
- All content should be contained within landmarks. Ever page at least needs a
main
landmark so I recommend you use that instead of where you have used section. - Img elements must always have an alt attribute. It is a serious accessibility failure to leave that off. Images that are meaningful content must have a proper alt description or images that are purely decorative can have the alt left blank. There is a good post in the resources channel on discord about how to write good alt text.
- You don't need all these extra divs wrapping tbe child elements of the card like the image, learning tag, and text content. As a general rule try to keep the html as simple and minimal as possible.
- What is it you envisage clicking on the "learning" button would do? I am.veru surprised you've made that into a button as it is unusual for tags in a card design like this to be clickable. It would help if you explained your thinking behind that choice.
- The published date is definitely not a heading element. It's just a paragraph, and can optionally include the time element for the date part. It's very important to use headings appropriately and in the correct order.
- When building single components like this, think about the context of where they would be used in a real website. This kind of card is likely to be in a grid or list with other blog cards or in a sidebar on another page. It is extremely unlikely this card would ever act as a page title. That tells you the heading must not be a h1. A h2 would be a more appropriate heading level.
- Similarly, the author name is definitely not a heading either, it's just a paragraph. Note how it has no content underneath it — it's not acting as a heading for any content. I can't stress enough how important headings are for an accessible site. They are some of the most important elements for communicating content structure and for navigation. It's very important to use them only in the right places and in the correct order.
- Get into the habit of including a full modern css reset at the start of the styles in every project. Andy Bell or Josh Comeau both have good ones you can look up and use.
- The picture element must not have an explicit width. That is what is breaking this solution for me and causing it to overflow my screen on the sides. Let it be width 100%. (It really doesn't need to be flex either).
- The card should have padding on all sides. The child elements within it should.only need vertical margins and no padding. Make sure you understand the difference between padding and margin.
- ⚠️ Font size must never be in px. This is extremely important.
- You will also never want to use em for font size. That can lead to really awful bugs because em font sizes compound. You only want to use the em unit in specific instances where you need a property to scale with the current elements font size. For example, padding on a button or letter spacing would both be good use cases for the em unit.
- To make the whole card clickable (as is the design intention) make the card component position relative, then add a pseudo element to the blog title anchor. Make that pseudo cover the whole card and it will all become clickable.
Once you've remedied this challenge, go back through previous ones and apply the learnings before moving on to anything new. Good luck.
1 - All content should be contained within landmarks. Ever page at least needs a
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