
Design comparison
Solution retrospective
I tried to use variable fonts it didn't resonate with the design. Then I tried to use it locally using @font-face
, it also didn't come up right. Finally, I tried using google fonts, which went along with the design.
I had problems with making the tag Learning
as an inline element, without taking the whole container width, but finally, found the solution using align-self
.
It would be great, if I can get input on arears where I can improve my code, both in my HTML as well as CSS
Community feedback
- P@SelinaLaveryDevPosted 17 days ago
Hey @ahsanma,
You mentioned challenges using @font-face - you were actually doing everything right, you were just missing "" quotes around the url. So here:
/* font-family: "Figtree", sans-serif; */ /* src: url(./assets/fonts/Figtree-VariableFont_wght.ttf) format("ttf-variations");
change it to:
src: url("./assets/fonts/Figtree-VariableFont_wght.ttf")
That should work for you now! I hope that helps :)
Marked as helpful0 - P@huyphan2210Posted 17 days ago
Hi @ahsanma,
I've checked out your solution and wanted to share some thoughts:
- You're using a
<span>
forLearning
, which is an inline element. The issue you encountered happened because its parent is a Flexbox withflex-direction: column
. This makes the<span>
behave as if it has full width due to how inline elements interact in a column layout. You resolved it usingalign-self: start
, which was the right move. - Wrapping the
<img>
in a<figure>
for the illustration is a good practice (though the<img>
can stand alone as it's the only child). You could apply the same approach to<div class="author">
—converting it into<figure class="author">
and wrapping the author’s name in a<figcaption>
instead of a<p>
. This would reduce unnecessary nesting. - The
Published 21 Dec 2023
text would be better suited inside a<time>
tag rather than a<p>
, as it represents a specific date. - Consider adopting a CSS naming convention. I personally use BEM, as it helps maintain a structured and scalable codebase.
- Using
rem
is great for scalability, but for values like0.6993rem
, consider switching topx
for better precision.
Hope this helps! 😊
Marked as helpful0@ahsanmaPosted 17 days agoHi @huyphan2210,
Thank you so much for providing feedback.
Starting from my next design challenge, I will try to implement BEM methodology.
Meanwhile I will update this project, based on your suggestions.
Thanks Again
1 - You're using 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