Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there CSS Grid highlighting in Chrome Developer Tools?

In the developer tools of Firefox, it is possible see the CSS grid, and also see when it is not selected.

Is it possible to show a CSS Grid in the developer tools of Chrome, also when the grid is not selected?

like image 512
asv Avatar asked Jan 23 '18 15:01

asv


People also ask

Does CSS Grid work in Chrome?

The supporting browsers Other than in Internet Explorer, CSS Grid Layout is unprefixed in Safari, Chrome, Opera, Firefox and Edge.

Do all browsers support CSS Grid?

Most developers are afraid to start using CSS Grid because of browser support, but CSS grid is fully supported in all main browsers: Chrome, Firefox, Safari, Edge including their mobile versions.

How do I get grid on my browser?

When an HTML element on your page has display: grid or display: inline-grid applied to it, you can see a grid badge next to it in the Elements panel. Clicking the badge to toggle the display of a grid overlay on the page.


2 Answers

Chrome v62 added Grid highlighting support to its dev tools:

To view the CSS Grid that's affecting an element, hover over an element in the DOM Tree of the Elements panel. A dashed border appears around each of the grid items. This only works when the selected item, or the parent of the selected item, has display:grid applied to it.

CSS Grid highlighting example

The Chrome Developers article above also includes a link to a short Google Developers YouTube video on using it: https://www.youtube.com/watch?v=AqwPrR7hklE


Prior to Chrome v62 there was no way in the Chrome dev tools to inspect grids like this. It's one of areas where Firefox dev tools were—and continue to be—significantly stronger. At the time, Chrome-latest did support the highlighting of various CSS Grid cells and tracks, though.

There are also CSS Grid inspector addons for Chrome that may support this feature. I don't use any of them, but there are at least half a dozen I have seen. One that looks promising is Gridman - CSS Grid Inspector (I have no affiliation with this addon or developer).

like image 93
TylerH Avatar answered Sep 20 '22 08:09

TylerH


Actually Chrome Dev Tools (at least from version 62 from August 2017) do provide without addon CSS grid highlighting:

To view the CSS Grid that's affecting an element, hover over an element in the DOM Tree of the Elements panel. A dashed border appears around each of the grid items. This only works when the selected item, or the parent of the selected item, has display:grid applied to it.

like image 40
r1oga Avatar answered Sep 21 '22 08:09

r1oga