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 using the cascade a bit

Ryan Hardyā€¢ 60

@ryyHardy

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 liked how I used the CSS cascade this time to clean up the CSS a bit for the text elements. I did not fully match the design because I read the text was supposed to be smaller on mobile and the dimensions of the card looked slightly different in the design files.

What challenges did you encounter, and how did you overcome them?

Organizing the text elements was difficult because they were similar, but had slight differences. I used a "p" selector to basically set a default for the paragraphs and I overwrote them slightly for each text element. That helped, but I still needed to use a lot of weird values for the units and I'm sure there is a better way.

What specific areas of your project would you like help with?

I was wondering if I should have used different units for a lot of the spacing challenges I had. I tried to use a mix of em, rem, and % but I'm not sure if I did that correctly. Also, I feel like the CSS for the active states looks a little weird.

Also, I used a lot of descendant selectors like ".class1 .class2" and I'm not sure if there is an alternative or if it was even necessary to do that in most of them.

Community feedback

Daniel šŸ›øā€¢ 38,550

@danielmrz-dev

Posted

Hello there!

Congrats on completing the challenge! āœ…

Your solution looks excellent!

I have just one suggestion:

  • Use <main> to wrap the main content instead of <main> and <article>.

šŸ“Œ The tag <article> would make more sense if the card was part of a bigger website (in certainly would in real world), but here it is all we have on the screen.

Unless you have a specific reason to use both, there's no need, considering that you can achieve the same result with only one. It also makes it easier positioning the elements inside.

This tag change does not impact your project visually and makes your HTML code more semantic, improving SEO optimization as well as the accessibility of your project.

I hope it helps!

Other than that, great job!

Marked as helpful

0

Ryan Hardyā€¢ 60

@ryyHardy

Posted

@danielmrz-dev Hi! Thanks for your advice. I am still learning when to use a lot of the semantic HTML tags so I definitely value the feedback I get in that area. I really appreciate it.

0

@0xabdulkhalid

Posted

Hello there šŸ‘‹. Congratulations on successfully completing the challenge! šŸŽ‰

  • I have a suggestion regarding your code that I believe will be of great interest to you.

HTML šŸ·ļø:

  • This attribution element on your solution actually needs to be a footer element instead of div element which causes lacking of landmark for a webpage and allows accessibility issues to screen readers.
  • What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like <div> or <span>. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
  • For example:
    • The <footer> typically contains information about the author of the section, copyright data or links to related documents.
  • So resolve the issue by replacing the <div class="attribution"> into a <footer> element in your index.html file to improve accessibility and organization of your page
  • Additionally you need to move out the footer from being inside the main element, because the main and footer elements needs to be direct child of body element.

.

I hope you find this helpful šŸ˜„ Above all, the solution you submitted is great !

Happy coding!

1

Ryan Hardyā€¢ 60

@ryyHardy

Posted

@0xabdulkhalid Thank you for pointing that out! I always appreciate accessibility feedback and I want to get better at noticing those things as I work on problems.

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