Design comparison
Solution retrospective
- Learnt how to tidy up my code by establishing variables.
- Learnt how to import custom fonts using:
@font-face {
font-family: ;
src: url();
}
What challenges did you encounter, and how did you overcome them?
I struggled with vertically and horizontally aligning the main section again.
My mistake was not declaring min-height when I tried placing my items in the center.
.wrapper {
display: grid;
place-items: center;
min-height: 100dvh;
}
What specific areas of your project would you like help with?
- My flexibility on using flexbox and grid interchangeably.
- rem vs. em.
- height vs. max-height vs. min-height.
- vh vs. dvh.
- Hovers and transitions.
Community feedback
- @MikDra1Posted 2 months ago
rem vs. em
- rem: Relative to the root element (<html>) font size. If the root has font-size: 16px, 1rem = 16px, making it consistent across the page.
- em: Relative to the font size of the current element’s parent. If a parent has font-size: 20px, and an element is set to 1.5em, it becomes 30px.
height vs. max-height vs. min-height
- height: Sets the fixed height of an element.
- max-height: Sets the maximum height; the element cannot grow beyond this.
- min-height: Ensures the element doesn’t shrink below this height.
vh vs. dvh
- vh (Viewport Height): 1vh equals 1% of the viewport height, changing as the viewport size changes.
- dvh (Dynamic Viewport Height): Accounts for dynamic changes, like mobile browser toolbars.
Hope you found this comment helpful 💗💗💗
Good job and keep going 😁😊😉
Marked as helpful0 - @StroudyPosted 2 months ago
Awesome job tackling this challenge! You’re doing amazing, and I wanted to share a couple of suggestions that might help refine your approach…
-
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
-
For future project, You could downloading 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 -
Developers should avoid using pixels (
px
) because they are a fixed size and don't scale well on different devices. Instead, userem
orem
, which are relative units that adjust based on user settings, making your design more flexible, responsive, and accessible. For more information check out this, Why font-size must NEVER be in pixels or this video by Kevin Powell CSS em and rem explained.- Another great resource for px to rem converter. -
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,
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! 🌟
0 -
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