bashaR_07⚡
KPCKevin Powell - Community
•Created by bashaR_07⚡ on 7/9/2024 in #front-end
Trouble in using "em" "rem" and "%" in Grid- Need Guidance
I am using Grid in my recent practice and tried to use relative units for elements of grid items. As this is suggested that we shouldn't give height or width while using flexbox and grid so did i and couldn't use % unit for elements in grid items as height and width were not set . And while using "em" , as the font size of the element or its parent is not set and it willl use root element 16 px which would be same as using "rem". After using "rem" , content is overflowing out of grid making it irresponsive as 16px of root doesn't change with dimensions , so i would have to add multiple media queries.
Btw, i like to use %.
What should be my approach making it responsive?
I want to know multiple ways of it, if someone can tell me?
Checkout my Code Pen : https://codepen.io/Mubashir-Hassan-the-scripter/pen/NWZWmZr
8 replies