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

FAQ accordion - Js - mobile design working

@mbilal-x

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Q. here should px units be avoided. My mobile design was perfect but when I started to work on desktop design I had to rewrite all margin and padding values, I wished I had used rem for them. Which one is better??

Community feedback

imad 3,330

@imadvv

Posted

Salam Moahamad!!, Mabrouk completing Your challenge!,

The px unit is something that gets you started very easily, but it turns into a problem later down the road This article has more details about why you should avoid using px over author units.

but in general I think is each has his one use case, for controlling Layout and font size I think rem unit along side with max-width, and for controlling the width of text ch units make best option as is relative to character , and for controlling elements inside a component I usually go with % , case the component controlled by layout ,and let px for things like border-width or some decorative Pseudo-elements stuff like that.

but over all, Hope this Help! and correct me if am wrong, am in process of learning too,

have a Good Week

Marked as helpful

1

@mbilal-x

Posted

@imadbg01

Thanks so much Imad.

This really helps. you summarized it all. and can you please share that link to the article again, it's not working. Thanks again

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