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: Capture node screenshot in DevTools saves just one element as an image

Devtools
~/tips/tip-devtools-capture-node-screenshot

right-click the node > Capture node screenshot

Get a tidy picture of a single card or table without cropping by hand.

When I need a picture of one card, table or button, cropping a screen grab never gives clean edges. DevTools can cut it out for me.

Pick the element, then use the context menu in the Elements panel:

right-click the node > Capture node screenshot

A PNG of that element, and nothing around it, lands in your downloads. To choose the node fast, press Ctrl+Shift+C (Cmd+Shift+C on a Mac), click the thing on the page, and the right line is already highlighted in the tree.

It is great for documentation and bug reports. A long table that does not fit on screen is a good test: select the table node instead of one row and you get the whole thing in one image. For sharper output on a normal screen, turn on the device toolbar and raise the device pixel ratio before capturing.

The image shows the element as it is at that moment, so a hover menu or tooltip may have closed by the time you right-click. Backgrounds that come from a parent element can be missing or look different. And check the picture for names or account numbers before you paste it into a ticket, because a crop still contains whatever was inside the box.

Further reading: Chrome DevTools: view and change the DOM

More Devtools tips Clear site data for one site from Chrome DevTools user.id === 42 $x(path [, startNode]) @media (prefers-color-scheme: dark) { queryObjects(Promise) All Devtools tips (22) All topics

Link