Basically I have a div that I want at 100% width. However, I also want it to have some padding. But when I add the padding, the width is added to it, meaning that my div now goes off-screen and there’s a horizontal scroll bar.
Usually I compensate by just making the div a lower percentage (like 95%, or 90%).
I was wondering if there are any more elegant ways to handle this situation?
Try setting the padding to 5% and width to 90% (100-5×2)