Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Blog preview card

Cheikh Sy 30

@chkhs

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

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

@dmolthu

Posted

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 helpful

0
T
Grace 29,310

@grace-snow

Posted

Hi, here is some feedback as requested, I hope it helps.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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).
  10. 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.
  11. ⚠️ Font size must never be in px. This is extremely important.
  12. 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.
  13. 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
Herve 40

@HerveWabo

Posted

Great job. nice additions on the H1 link and the button. why did you choose button over an anchor for the blog category?

0

Cheikh Sy 30

@chkhs

Posted

hmmm i Just noticed that.@HerveWabo

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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