Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Blog-preview-card-main

mateusb12โ€ข 50

@mateusb12

Desktop design screenshot for the Blog preview card coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I would start focusing on starting right off the bat using rem units instead of pixel units

What challenges did you encounter, and how did you overcome them?

Creating the shadow using the ::before special tag was very difficult for me, specially while tackling the responsiveness isue

What specific areas of your project would you like help with?

I would like to know how to exactly decide which units I should use when starting a project like this (pixel, rem, etc)

Community feedback

P
Koda๐Ÿ‘นโ€ข 3,810

@kodan96

Posted

hi there! ๐Ÿ‘‹๐Ÿ‘‹

You should avoid hard-coded values (pixels) most of the time. When you use these values you give up responsiveness(or you make it harder for yourself at least)..

Typically you will increase the font-size property with @media queries. If you have hard-coded values all over your CSS, you need to modify every element's font-size . On the other hand, if you use rem -s all you need to do is changing the font-size in your CSS :root selector and all your elements will have a new size based on that value.

I usually use em for padding and margin for text-based elements, since their margin usually based on their font-size , and again, when you change the font-size in :root these values will scale up as well without you touching them, making your job easier and your page maintainable.

If you are not familiar with the :root selector it's usually used to set custom properties(others call them CSS variables ) that you can apply later.

Hope this helped ๐Ÿ™

Good luck and happy coding! ๐Ÿ’ช

Marked as helpful

1

Account Deleted

it's very simple, use percentage to define the highest element which would be the <html> example, remember the default font size for browser is 16px so set your root element like this; since your root element is now 10px you can star using rem to defined the rest. 2rem would be = 2x the root element making it 20px. you can read more about this

html{ font-size: 64% }

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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