Design comparison
Solution retrospective
The first challenge was adding a distance between list markers and text. I found a solution in Stack overflow page.
The second challenge was a nutrition table, where I couldn't make an underline below the nutrition value. I decided to add 4 tables for every single nutrition value and add div with underline class under every of the tables.
What specific areas of your project would you like help with?In the instructions section, the wrapped text is under the list number, which shouldn't be there, but I can't find a solution for this problem
Community feedback
- @Abo3bazezPosted 2 months ago
You have done a good job with the challenges you have faced. I have some advice to offer:
1.Nutrition Table Problem
- You don’t have to create 4 separate tables, or even a table for the nutrition facts. Instead, you can use a layout like this and style it using Flexbox:
html <div class="table"> <div class="box border-1"> <div class="key">Calories</div> <div class="value">277kcal</div> </div> <div class="box border-1"> <div class="key">Carbs</div> <div class="value">0g</div> </div> <div class="box border-1"> <div class="key">Protein</div> <div class="value">20g</div> </div> <div class="box"> <div class="key">Fat</div> <div class="value">22g</div> </div> </div>
Then, use Flexbox to style it:
css .table .box { display: flex; justify-content: space-around; }
2.Wrapped Text Under the List Number
- To prevent the text from wrapping under the list number, wrap the entire text in
<p>
tags like this:
html <ul> <li> <p><span>Total: </span>Approximately 10 minutes</p> </li> <li> <p><span>Preparation: </span>5 minutes</p> </li> <li> <p><span>Cooking: </span>5 minutes</p> </li> </ul>
Marked as helpful1 - @StroudyPosted 2 months ago
Hello again, fantastic effort on this! You’re really nailing it. Just a few things I noticed that could make it even better…
-
This does not matter that much at this stage but something to be mindful of for SEO(Search Engine Optimisation),
<meta>
description tag missing that helps search engine determine what the page is about, Something like this<meta name="description" content="description goes here" />
-
Your HTML is set to
10px
and whilepx
is useful for precise, fixed sizing, such asborder-width
,border-radius
,inline-padding
, and<img>
sizes, it has limitations. Pixels don't scale well with user settings or adapt to different devices, which can negatively impact accessibility and responsiveness. For example, usingpx
for font sizes can make text harder to read on some screens, Check this article why font-size must NEVER be in pixels. In contrast, relative units likerem
andem
adjust based on the user’s preferences and device settings, making your design more flexible and accessible. Usepx
where exact sizing is needed, but prefer relative units for scalable layouts. If you want a deeper explanation watch this video by Kevin Powell CSS em and rem explained. Another great resource I found useful is this px to rem converter based on the default font-size of 16 pixel. -
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,
-
For future project, You could download and host your own fonts using
@font-face
improves website performance by reducing external requests, provides more control over font usage, ensures consistency across browsers, enhances offline availability, and avoids potential issues if third-party font services become unavailable. Place to get .woff2 fonts
You’re doing fantastic! I hope these tips help you as you continue your coding journey. Stay curious and keep experimenting—every challenge is an opportunity to learn. Have fun, and keep coding with confidence! 🌟
Marked as helpful0 -
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