brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: the grid badge in Firefox's Inspector draws your layout's lines on the page

Firefox
~/tips/tip-firefox-grid-inspector-overlay

Inspector > click the "grid" badge

See grid lines, line numbers and area names directly over the page.

CSS grid problems are hard to reason about from the code alone. I want to see where the lines actually are, and Firefox will paint them for me.

In the Inspector, find the element with display: grid. It has a small grid badge next to it in the markup:

Inspector > click the "grid" badge
Layout tab > Grid > Grid Display Settings

Click the badge and an overlay appears with the tracks and gaps drawn on the live page. Line numbers are shown by default, and so are area names if you use grid-template-areas.

Say a card refuses to sit in the third column. With the overlay on, you can read the line numbers and see that grid-column: 3 starts somewhere else than you assumed, or that the browser made fewer columns than you expected at this width.

The settings also offer extending the lines across the whole page, which helps when you want to check whether things outside the grid line up with it.

The overlay stays on while you resize, so try a few widths. It only covers grid containers, not flexbox, and on a busy page several overlays at once get noisy fast. Click the badge again to remove it.

Further reading: Firefox DevTools: examine grid layouts

More Firefox tips view-source:https://www.mozilla.org/#line100 ^ invoice history about:processes right-click the request > Edit and Resend Windows and Linux: Ctrl+B All Firefox tips (10) All topics

Link