@MarcosFarias21
Posted
I would suggest you to search more about breakpoints and media queries. I personally set my breakpoint at the width of 1024px(you can convert it to "em") so devices with a viewport width higher than 1024px(64em) desktop design of the page will be displayed. As well as devices with a viewport width lower than that will have the mobile design of the page. Why 1024px?, well we have to consider the tablets too. But this value can vary depending on how you want the content to be fit on the page.
Marked as helpful
@MarcosFarias21 That makes sense! I was trying to make the breakpoints match the provided screen width in the challenge, but you're right, it doesn't have to be exactly 375px. I didn't think about that. I'll update my media query to make it more fluid. Thank you for your insight!
@vanzasetia
Posted
@aszcoding I would recommend writing the styling using the mobile-first approach which means that you are using min-width
media queries instead of max-width
. It often leads to shorter and better performance code. Also, mobile users won't be required to process all of the desktop styles.
@MarcosFarias21
Posted
@vanzasetia Well said!. I always approach mobile design first and then apply media queries for desktop version changing some measurement properties and adding some unique desktop style touches.
@MarcosFarias21
Posted
@aszcoding of course!