A little while ago I realized that using % for width instead of px can help with compatibility across devices, but yester when I tried it I realized that the width of a child element is the % of the width of the parent element, not the screen, so I had to redo everything. What a pain.
you can use vw and vh for even better compatibility. also margins for table/div aspect ratios although tbh that reduces compatibility a little bit