Page Inspector

  • Revision slug: Tools/Page_Inspector
  • Revision title: Page Inspector
  • Revision id: 18866
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 24 words added

Revision Content

{{ fx_minversion_header("10.0") }}

Firefox 10 introduces the new Page Inspector, a handy tool that you can use to examine the structure and layout of a page. Choose the "Inspect" option from the "Web Developer" menu (which is a submenu in the "Tools" menu on the Mac), or press Ctrl-Shift-I (Cmd-Option-I) on the Mac. Once the Page Inspector is active, you can then click on the element you want to examine. You can also directly choose an element without first invoking the Page Inspector by right clicking on it and choosing "Inspect Element" from the context menu.

While you're mousing around the page, the inspector will show you information about the element you're currently pointing at; the display looks something like the below:

inspect-select.png

In this image, you can see the user is pointing at the BrowserID "Sign in" button near the top of the page. The rest of the page is dimmed. A popup box indicates that the element is an HTML {{ HTMLElement("a") }} (anchor) element with the class "browserid-signin". At the bottom of the page is the Page Inspector toolbar, which we'll look at in more detail in the next section.

Until you click on an element (unless you right-clicked an element and selected "Inspect Element" directly), as you mouse around, this display automatically updates with information about the element currently under your cursor. Once you click an element, the display locks so you can look at the information in detail.

The Page Inspector toolbar

The toolbar the Page Inspector adds to the bottom of the browser window looks like this:

page-inspector-toolbar-diagram.png

There are five control areas in the Page Inspector's toolbar:

Close button
The "X" icon at the left end of the toolbar is the close button; clicking it closes the Page Inspector. Pressing the escape key while the document is focused has the same effect.
Inspect (Ctrl-I)

The Inspect button locks and unlocks the toolbar to reflect the currently highlighted element. If you click this while locked on a specific element, the element is deselected and you can select a new one by mousing around in the browser window. Clicking it while no element is currently selected will select the element currently pointed at by the mouse.

Breadcrumbs: element hierarchy (arrow keys)
The majority of the toolbar is occupied by the breadcrumbs bar. This bar shows the hierarchy of all the nested elements, with its parent elements to the left and child elements to the right. Each element's element and CSS style and/or class is shown. If the information is cut off, mousing over the element's entry in the toolbar presents a tooltip with the complete description. If you click and hold on one of the elements in the bar, a popup menu appears that lets you select one of that element's siblings. Clicking the small arrow icons at the left and right ends of the bar will scroll the bar if it's wider than the available space; you can also use the arrow keys to navigate the element hierarchy bar.
3D View button
Toggles the 3D view on and off. See {{ anch("Using the 3D view") }} for details.
HTML button (Ctrl-H)
The HTML button toggles on and off the HTML panel, which provides a view at the HTML that created the selected element.
Style button (Ctrl-S)
The Style button toggles on and off the Style panel, which shows the CSS responsible for styling the selected element.

Keyboard shortcuts

There are a number of handy shortcuts you can use while inspecting your page.

Shortcut Description
Moves to the parent of the selected node.
Moves to the first child of the selected node.
Moves to the previous sibling of the selected node.
Moves to the next sibling of the selected node.
ESC Closes the Page Inspector.
Return/Enter Locks and unlocks the currently highlighted element as the selected element to inspect.

Using the Page Inspector with the Web Console

You can, of course, use the Web Console at the same time as the Page Inspector. In fact, you even have a bonus feature! The element that's currently selected in the Page Inspector, if any, can be referenced in JavaScript in the Web Console using the variable $0.

web-console.png

Using the 3D view

coming soon.

See also

{{ languages( { "ja": "ja/Tools/Page_Inspector"} ) }}

Revision Source

<p>{{ fx_minversion_header("10.0") }}</p>
<p>Firefox 10 introduces the new Page Inspector, a handy tool that you can use to examine the structure and layout of a page. Choose the "Inspect" option from the "Web Developer" menu (which is a submenu in the "Tools" menu on the Mac), or press Ctrl-Shift-I (Cmd-Option-I) on the Mac. Once the Page Inspector is active, you can then click on the element you want to examine. You can also directly choose an element without first invoking the Page Inspector by right clicking on it and choosing "Inspect Element" from the context menu.</p>
<p>While you're mousing around the page, the inspector will show you information about the element you're currently pointing at; the display looks something like the below:</p>
<p><img alt="inspect-select.png" class="internal default" src="/@api/deki/files/6070/=inspect-select.png" style=""></p>
<p>In this image, you can see the user is pointing at the BrowserID "Sign in" button near the top of the page. The rest of the page is dimmed. A popup box indicates that the element is an HTML {{ HTMLElement("a") }} (anchor) element with the class "browserid-signin". At the bottom of the page is the Page Inspector toolbar, which we'll look at in more detail in the next section.</p>
<p>Until you click on an element (unless you right-clicked an element and selected "Inspect Element" directly), as you mouse around, this display automatically updates with information about the element currently under your cursor. Once you click an element, the display locks so you can look at the information in detail.</p>
<h2>The Page Inspector toolbar</h2>
<p>The toolbar the Page Inspector adds to the bottom of the browser window looks like this:</p>
<p><img alt="page-inspector-toolbar-diagram.png" class="internal default" src="/@api/deki/files/6072/=page-inspector-toolbar-diagram.png" style=""></p>
<p>There are five control areas in the Page Inspector's toolbar:</p>
<dl> <dt>Close button</dt> <dd>The "X" icon at the left end of the toolbar is the close button; clicking it closes the Page Inspector. Pressing the escape key while the document is focused has the same effect.</dd> <dt>Inspect (Ctrl-I)</dt> <dd> <p>The Inspect button locks and unlocks the toolbar to reflect the currently highlighted element. If you click this while locked on a specific element, the element is deselected and you can select a new one by mousing around in the browser window. Clicking it while no element is currently selected will select the element currently pointed at by the mouse.</p> </dd>
</dl>
<dl> <dt>Breadcrumbs: element hierarchy (arrow keys)</dt> <dd>The majority of the toolbar is occupied by the breadcrumbs bar. This bar shows the hierarchy of all the nested elements, with its parent elements to the left and child elements to the right. Each element's element and CSS style and/or class is shown. If the information is cut off, mousing over the element's entry in the toolbar presents a tooltip with the complete description. If you click and hold on one of the elements in the bar, a popup menu appears that lets you select one of that element's siblings. Clicking the small arrow icons at the left and right ends of the bar will scroll the bar if it's wider than the available space; you can also use the arrow keys to navigate the element hierarchy bar.</dd> <dt>3D View button</dt> <dd>Toggles the 3D view on and off. See {{ anch("Using the 3D view") }} for details.</dd> <dt>HTML button (Ctrl-H)</dt> <dd>The HTML button toggles on and off the <a href="/en/Tools/Page_Inspector/HTML_panel" title="en/Tools/Page_Inspector/HTML panel">HTML panel</a>, which provides a view at the HTML that created the selected element.</dd> <dt>Style button (Ctrl-S)</dt> <dd>The Style button toggles on and off the <a href="/en/Tools/Page_Inspector/Style_panel" title="en/Tools/Page_Inspector/Style panel">Style panel</a>, which shows the CSS responsible for styling the selected element.</dd>
</dl>
<h2>Keyboard shortcuts</h2>
<p>There are a number of handy shortcuts you can use while inspecting your page.</p>
<table class="standard-table" style="width: auto;"> <tbody> <tr> <td class="header">Shortcut</td> <td class="header">Description</td> </tr> <tr> <td>←</td> <td>Moves to the parent of the selected node.</td> </tr> <tr> <td>→</td> <td>Moves to the first child of the selected node.</td> </tr> <tr> <td>↑</td> <td>Moves to the previous sibling of the selected node.</td> </tr> <tr> <td>↓</td> <td>Moves to the next sibling of the selected node.</td> </tr> <tr> <td>ESC</td> <td>Closes the Page Inspector.</td> </tr> <tr> <td>Return/Enter</td> <td>Locks and unlocks the currently highlighted element as the selected element to inspect.</td> </tr> </tbody>
</table>
<h2>Using the Page Inspector with the Web Console</h2>
<p>You can, of course, use the Web Console at the same time as the Page Inspector. In fact, you even have a bonus feature! The element that's currently selected in the Page Inspector, if any, can be referenced in JavaScript in the Web Console using the variable <code>$0</code>.</p>
<p><img alt="web-console.png" class="internal default" src="/@api/deki/files/6078/=web-console.png"></p>
<h2>Using the 3D view</h2>
<p>coming soon.</p>
<h2>See also</h2>
<ul> <li><a href="/en/Tools" title="Tools">Tools</a></li> <li><a href="/en/Tools/Web_Console" title="Using the Web Console">Using the Web Console</a></li> <li><a href="/en/Tools/Scratchpad" title="Scratchpad">Scratchpad</a></li>
</ul>
<p>{{ languages( { "ja": "ja/Tools/Page_Inspector"} ) }}</p>
Revert to this revision