Blog-preview-card

Solution retrospective
I’d really appreciate it if you could take a moment to share your feedback on this project. I'm open to suggestions on how I can improve and would love to hear your thoughts on what worked well and what could be done better.
Also, if there are any specific areas I should focus on or keep in mind for future projects, I’d be grateful for your guidance.
Thankyou!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @DomCroatia
Hey, congratulations on finished challenge!
First thing I'd like to mention is semantic HTML. Having a lot of divs as a containers for content is ok, but they don't have any meaning whatsoever. For example, instead of using div with class='container', you could use <main> element and <article> instead of
div.main
. It makes your content more meaningful for screen-readers and other assisted technologies. Some other semantic elements besidesmain
are: article, section, aside. footer, header, nav (I'm probably missing some). For smaller projects like this we don't use a lot of them but using them is good habit to develop.Regarding responsiveness, you don't have to give your elements strict
width
orheight
value. You can use min/max width/height (ex., min-height:100vh; onbody
element so it always takes full height, but expands more if content requires it or max-width ondiv
with class of.card
helps with content in your card stretching too far on big screens, and helps make card smaller on smaller screen because content in it dictates it's size).Also I noticed your button has
width
on it aswell. If you reduce viewport bit-by-bit you can see that at some point yellow background on it is not covering full button. The reason is because it is "reduced" to 25% of width. Better way to do this, in my opinion, is to addalign-items: start;
on parent element and remove width property from button, you can see now that background covers full width of it.Lastly, you put your
img
element into div, (and I think that is good for styling purposes), but you didn't give that divwidth: 100%;
to make it responsive.
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