Design comparison
Solution retrospective
I am still learning and for this challenge, I tried a few things for the first time:
- Using the Figma file
- CSS custom properties
- Media query
Setting custom properties for the colors and text styles helped tremendously when working with the Figma file.
What challenges did you encounter, and how did you overcome them?I couldn't change the font size for mobile screen initially. I thought setting font-size
at body
would do the trick since I have set the text styles in rems. Instead, I needed to set the font-size
at :root
.
I would appreciate feedback on any flaws in my code and suggestions for a better implementation. What would you have done differently for this challenge?
Community feedback
- @StroudyPosted about 2 months ago
Exceptional work! You’re showing great skill here. I’ve got a couple of minor suggestions that could make this stand out even more…
- Having a clear and descriptive
alt
text for images is important because it helps people who use screen readers understand the content, making your site more accessible. It also improves SEO, as search engines usealt
text to understand the image's context, helping your site rank better, Check this out Write helpful Alt Text to describe images,
<div class="card-image"> <img src="./assets/images/illustration-article.svg" alt="" /> </div>
-
Overusing
<div>
tags, known as "divitis," leads to cluttered code, poor semantics, and reduced performance. Instead, use appropriate semantic elements (like<header>
,<section>
, etc.) to improve readability, accessibility, and SEO. Keep HTML clean and minimal to ensure maintainability, scalability, and better CSS structure. -
These
<div> <span>
should really have semantic tags like headings (<h1> to <h6>
) and paragraphs (<p>
) convey structure and meaning to content, improving accessibility, SEO, and readability by helping search engines and screen readers interpret the content.
<span class="card-badge">Learning</span> <div class="published-date">Published 21 Dec 2023</div>
-
Using a full modern CSS reset is beneficial because it removes default browser styling, creating a consistent starting point for your design across all browsers. It helps avoid unexpected layout issues and makes your styles more predictable, ensuring a uniform appearance on different devices and platforms, check out this site for a Full modern reset
-
Using
rem
orem
units in@media
queries is better thanpx
because they are relative units that adapt to user settings, like their preferred font size. This makes your design more responsive and accessible, ensuring it looks good on different devices and respects user preferences.
@media (width <= 600px)
- I think you can benefit from using a naming convention like BEM (Block, Element, Modifier) is beneficial because it makes your CSS more organized, readable, and easier to maintain. BEM helps you clearly understand the purpose of each class, avoid naming conflicts, and create reusable components, leading to a more scalable codebase. For more details BEM,
I hope you’re finding this guidance useful! Keep refining your skills and tackling new challenges with confidence. You’re making great progress—stay motivated and keep coding with enthusiasm! 💻
Marked as helpful1 - Having a clear and descriptive
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