Design comparison
Solution retrospective
I'm proud to have built the first more complex page and to have got it so close to the original.
I didn't look at all the templates in detail at the beginning, except for the mobile template that I started with. This meant that I was missing a few flexboxes, grids and divs later on, which I then had to add in html. I will do this differently for the next project.
What challenges did you encounter, and how did you overcome them?I was working with a Sketch template for the first time and didn't want to take out a subscription for the software. Fortunately, there is the Lunyca app from Icon8, which can read both Figma and Sketch files and is also free.This allowed me to get much closer to the design template than before.
What specific areas of your project would you like help with?I have not found a solution for how to enlarge the header image with the heads of the people so that it goes a little over the frame on the left and right and is cut off at the frame. If anyone has any tips on this, I would be very grateful.
Community feedback
- @juliengDevPosted 4 months ago
Hey there @carstenkoerner! 👋 Here are some suggestions to help improve your code:
Best Practices for Resetting Your CSS Code:
-
Reset Margins and Padding:
* { margin: 0; padding: 0; }
-
Consistent Box-Sizing Model:
*, *::before, *::after { box-sizing: inherit; }
By setting
box-sizing: inherit;
for all elements and pseudo-elements, the box model remains consistent throughout the document. Then, settingbox-sizing: border-box;
onhtml
ensures that all widths and heights include borders and padding, simplifying the calculation of element dimensions. -
Set Base Font Size:
html { box-sizing: border-box; font-size: 62.5%; }
Setting the base font size to
62.5%
onhtml
makes text size calculations easier. Since62.5%
of the default16px
font size equals10px
,1rem
equals10px
, simplifying conversions between relative (rem
) and absolute (px
) units. For example,1.6rem
equals16px
, which is more intuitive than working with text sizes based on a default16px
base size. -
Ensure Full Viewport Height:
body { min-height: 100vh; }
By setting
min-height: 100vh;
, the body of the document covers at least the viewport height, which is especially useful for "hero" layouts or ensuring the footer remains at the bottom of the page.
Additional Suggestions:
-
Font Size Adaptability: Consider using the
clamp()
function for more adaptive font sizes. It allows you to set a range of acceptable font sizes based on viewport dimensions, ensuring better readability across devices. -
Image Positioning in Header: You mentioned struggling with image positioning in the header. I used absolute positioning with negative left and right values. You can refer to my code for a detailed implementation of this solution.
<Happy Coding/>! 👾
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