CSS is full of history with lots of complicated ways of trying to manage position and layout information. The best thing I can see is to ignore almost all of it and instead use single methodology which is the grid layout which have been supported by all the major modern browsers since 2017.