How can I make my website adapt automatically?

Some digging and I managed to solve 80% of my problem, but it’s already helped me a lot, thanks guys