UI Tour - Firefox Developer Tools 编辑

This article is a quick tour of the main sections of the Page Inspector's user interface.

It covers the three top-level components of the Inspector's UI:

  • the "Select element" button
  • the HTML pane
  • the CSS pane

The all-new Inspector panel in Firefox 57.This guide is intentionally kept as short as possible. It links to various how to guides for the details of how to work with the Inspector.

Select element button

The Inspector gives you detailed information about the currently selected element. The Select element button is one way you can select an element for inspection:

This is the button in Firefox 57 Inspector you can use to select elements on a web page.

Note that it's actually part of the main toolbox toolbar, so it's immediately accessible from any tool, not just the Inspector.

To learn how to select an element, see the guide to selecting an element.

HTML pane

The Inspector is split into two or three sections, depending on your settings. You can toggle the 3-pane view of the Inspector. The following image shows the 2-pane layout:

These are the tasty new HTML and CSS panes in Firefox 57.

In 2-pane mode, the Inspector includes the HTML Pane, and the CSS Pane, which can contain one of six tools:

  • Rules view
  • Layout view
  • Computed view
  • Changes view
  • Compatibility view (Firefox Developer Edition 77 and later)
  • Fonts view
  • Animations view

The following image shows the 3-pane mode (available from Firefox 62 onwards) which moves the CSS Rules view into a separate pane in the center of the Inspector. The following image shows 3-pane mode:

As you can see, the CSS pane has moved into the center of the Inspector. To learn more about the structure of the HTML pane, see the guide to examining and editing HTML.

Rules view

The Rules view lists all the rules that apply to the selected element, ordered from most-specific to least-specific. See above.

The rules view within the Inspector.

See Examine and edit CSS for more details.

Layout view

The Layout view displays the box model of the page. If the page includes any sections using either the Flexbox display model or CSS Grids, this view shows the Flexbox or Grid settings used on the page.

To learn more about the Layout view, see Examine and edit the box model. Note that before Firefox 50, the box model view did not appear in the "Computed view" tab, but had its own tab.

To learn more about the CSS declarations listed in this view, see Examine computed CSS.

Changes view

When you are editing in the Rules view, you can see the changes you have made in the Changes view.

Screenshot of the Changes view

Computed view

The Computed view shows you the complete computed CSS for the selected element (The computed values are the same as what getComputedStyle would return.):

The Computed view within the Inspector.

Compatibility view

Starting with Firefox Developer Edition version 77, the Compatibility view shows CSS compatibility issues, if any, for properties applied to the selected element, and for the current page as a whole. It shows icons for the browsers that do support the properties, and notes properties that are experimental or deprecated.

Screenshot of the Compatibility view

  • Click the name of the property to open the reference article for that property on MDN Web Docs. The "Browser compatibility" section of the article gives details of browser support for the property.
  • In the All Issues section, click the name of the element that uses the property to select that element in the inspector. If more than one element has a given property applied to it, click the triangle to show all the occurrences.
  • To configure the set of browsers you want the Compatibility view to check for, click Settings at the bottom of the panel.

Screenshot of the Settings for the Compatibility view

Untick the checkbox for any browser you are not interested in. As new browser versions are released, the version numbers in this list will be updated.

Fonts view

The Fonts view shows all the fonts in the page along with editable samples.

The all-new Inspector panel in Firefox 57.

See View fonts for more details.

Animations view

The Animations view gives you details of any animations applied to the selected element, and a controller to pause them:

This is the Animations pane in the Firefox 57 Inspector.

See Work with animations for more details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:143 次

字数:8826

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文