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 with hover animation

P
Similo 20

@Chief-99

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 most proud of the hover animation that because I think it's pretty cool :)

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

One thing that I struggled with was getting the fonts to work properly but thankfully I was able to get some assistance from the discord and I was able to figure out how to get the result I was looking for. Another thing was the layout. There were a lot of things that I was not aware of, but thanks to the discord (again) I was able to find easier ways of doing things and eliminate a lot of unnecessary code.

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

I would like to know if there is any issue with my CSS model. Because I only just started I've found that the main issue I run into is just how I think about CSS, so I would really aoppreciate any feedback on eliminating any redundancy in my code and just making it cleaner.

Community feedback

T
Grace 29,310

@grace-snow

Posted

There are a couple of really important extra learnings from this challenge.

  1. You've called an element a heading in the class name so you obviously recognise it is a heading. Yet you've not used a heading element! It must have one. Probably a h2 as this component wouldn't ever be a page title.
  2. The whole point of this component is to signpost people to a blog article. The design even shows it has a hover/focus style so must be interactive. But you've not included a link. That's essential. It should wrap the blog title, inside the heading element when you add it.
  3. Once the html is corrected you can add the hover and focus styles onto the link. To make the whole card clickable, you'd usually make the card position relative and give the link a pseudo element that is absolutely positioned over the whole card.
  4. (Recommendation) Include the reset at the start of your styles. Don't add a whole extra css file for no benefit.
  5. Learning ribbon text must not have a width. This needs to be a robust solution where authors could add different ribbons/tags/categories and where users can set different font styles as needed. As soon as you set a fixed width you break all that. All this text element needs is some padding.
  6. This is touching the sides of my screen on all sides when it shouldn't. There should be some padding on a wrapping element.
  7. Remove the position fixed from the footer. It's unnecessary and all it does is cause overflow bugs.

Marked as helpful

2
P
Steven Stroud 4,120

@Stroudy

Posted

Hey welcome to Frontend Mentor, it's good to see you here and complete this challenge, great idea with the hover animation but it's probably best at this stage to not over complicate things, I noticed a few things to improve,

  • Your <img> alt attribute tag should not have a empty space like this alt=" ", It will confuse screen readers for accessibility.
  • Missing a <meta> description tag for SEO purposes,
  • Using max-width: 100% or min-width: 100% is way more responsive then just width:100%, check out this article also from the same Frontend mentor dev responsive-meaning, she goes into more detail.
  • You should avoid using px as it is an absolute unit and not a responsive unit like rem or em, You should look at this article from a Frontend mentor dev, Why font-size must NEVER be in pixels.
  • Line height is usually unitless instead of line-height: 150%; should use line-height: 1.5; this means it is 1.5 x the font-size, unitless value ensures that the line height will scale proportionately.

Marked as helpful

1

P
Similo 20

@Chief-99

Posted

@Stroudy Thank you for the feedback, it is much appreciated!!

  • So, I asked for help on the discord server and someone recommended an article to me and it basically said that for decorative images one should have an empty alt attribute. This is the article.
  • I am not sure exactly <meta> tags are, apologies (I only started this recently) but I will do some research so thank you for the suggestion!!
1
T
Grace 29,310

@grace-snow

Posted

@Chief-99 that's the key point, the alt must be empty for decorative images and that means no spaces or anything else. As soon as you add anything in there the image will be announced as an image but with no description which is baffling to screen reader users. Whereas when an alt is empty the accessibility API knows to ignore the image altogether.

1
P
Similo 20

@Chief-99

Posted

@grace-snow Oh I see, thank you for the clarification. So then would the correct thing be alt="" with no text or are you saying I just leave it out altogether?

0
T
Grace 29,310

@grace-snow

Posted

@Chief-99 that's correct. Alt attribute but with an empty value.

Img elements must always have the attribute present.

1

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