120

Chrome DevTools previously offered a setting to show rulers when inspecting elements. It had a pixel ruler at the sides of the view, and boundary lines for each element extending the full view of the page.

It used to be found (as I recall) in "DevTools Settings / General". There no longer is a General section, and I don't see it in "DevTools Settings / Appearance". Has this been moved, or removed? I'm not finding documentation or discussion of it.

2540625
  • 11,022
  • 8
  • 52
  • 58

4 Answers4

172

You can enable it in DevTools Settings > Preferences, under the Elements section.

To use, open the console and hover over an element to view the ruler. Thanks @Brandito for mentioning in the comment.

Show rulers

Lee Goddard
  • 10,680
  • 4
  • 46
  • 63
Gideon Pyzer
  • 22,610
  • 7
  • 62
  • 68
34
  1. Click Toggle Device Toolbar Toggle Device Toolbar which is in the top-left of your DevTools window.

  2. Click More Options and then select Show rulers.

    Show rulers

    The rulers are to the left of and above your viewport. You can click on the numbers to set the width and height to that size.

    Rulers

Kayce Basques
  • 23,849
  • 11
  • 86
  • 120
  • 4
    At first I was like, wow this is a really well formatted answer, great images! Then I saw who posted it... Mr 'What's new in Chrome / DevTools'! – brandito Oct 12 '18 at 02:36
  • 1
    @kayce-basques, so,what's up with the checkbox in the answer from @Gideon-Pyzer? Are the rulers that feature produce intended to only be shown when hovering the mouse over a element in the Elements tab in the devtools, or are we using it the wrong way? The "problem" with the rulers and features of the "Device toolbar" mode, is that when you use it, the page no longer look and render like it did right before you pressed the "Toggle device toolbar" button, and that can often be a problem. – NoOneSpecial Mar 17 '19 at 07:33
  • 16
    It would be great if this feature provided the ability to drag out guides and take measurements. Is there somewhere I can submit this suggestion? – Aaron Newton Apr 06 '19 at 09:08
  • 1
    I needed to restart Chrome to see rulers. – darmis Dec 09 '20 at 10:15
  • It's worth noting that if you have enabled the ruler in settings, when you toggle 'select element on page' and hover over elements, guide lines will show up. This occurs without enabling the mobile ruler, but when both settings are enabled, I find the combination to be useful. @AaronNewton ...I still think a full feature request should be submitted, if there's a way. – Shad Feb 03 '22 at 15:25
6

In Developer Mode Press Ctrl+Shift+P then type Ruler enter image description here

Amir Reza
  • 435
  • 1
  • 7
  • 15
5

Click on the Chrome setting, then:

  1. Under Preferences, Enable DevTools and enable Ruler.
  2. Go to your page and right click on it, then click inspect.
  3. Click Toggle Device Toolbar icon (top-left of DevTools window.

enter image description here

David Buck
  • 3,752
  • 35
  • 31
  • 35
Hanan Fadel
  • 107
  • 2
  • 3