@FluffyKas
Posted
Hey there,
Well done on this one, your solution looks very good! ^^ To answer your question: whenever you can, always use rem/em or other relative units, for pretty much everything. I only use pixels for really small things, like setting box-shadow or borders. By using pixels, you are hardcoding values which may not be suitable for all users. Some people like to change the default font size of their browser for example. If you set font-sizes, padding, etc in relative units (rem, em and the like), these will scale accordingly while px will overwrite user preferences. So if you want to keep responsive design/accessibility in mind, go with relative units, always :)
Regarding your solution, I only have one issue really: it's not necessary to nest a link inside a button
element (it's actually incorrect). Choose one or the other, depending on what's more suitable. If it redirect the user somewhere else, use a link. If it adds functionality, use a button, but never both.
Marked as helpful
@Rapha445
Posted
@FluffyKas Thanks a lot for the feedback, that's actually super helpful !
I see! I was wondering because my friend who's a web designer always builds her design in pixels. But I guess it's better to convert evrything into relative units for accessibility.
Noted for the nested link inside the button. I just corrected that and opted for a button element :)
Thanks!
@FluffyKas
Posted
@Rapha445 @Rapha445 This article is about this topic exactly! :) But to sum it up, I reckon most designs you encounter will be in pixels and it will be your task to translate them to relative units. It's a bit of a hassle at first but you'll get a feel for it very soon as you practice! ^^
Marked as helpful
@Rapha445
Posted
@FluffyKas Thanks for the link. Looks like a whole topic to dive into 😆