DEV Community

Cover image for HTML 5 Grid for Margins
John Peters
John Peters

Posted on • Edited on

HTML 5 Grid for Margins

Instead of using margins, you can use the HTML 5 grid. Assume each div with text uses the .text class.

Alt Text

This markup makes a Grid with one column that takes up 90% of free space. No need for right margins. It is viewport size agnostic, meaning that it works automatically on any screen size.

Top comments (0)