Alex Douglas Alex Douglas - 9 days ago 7
CSS Question

How to add a border around all elements in the body of a webpage?

There is some weird white space showing up on the right side of my website in mobile. I was wondering if there is a CSS trick to add a border to all the html elements within the body of a webpage so that I can figure out which element is extending out and causing the white space on mobile.

Thank you

Answer

You can try this CSS snippet:

* { border: 1px solid black; }

Every element should now get a border. Beware, this means everything. Hopefuly it'll help you figure out that white space in your app!

Include that CSS snippet before your CSS files so that it can be overwritten - or after, to force it onto every element.