The Inspect Element developer tool in Firefox allows you pinpoint the HTML code for anything you see on your web page. The HTML and accompanying CSS stylesheet are fully editable once these tools are open. Experiment with any changes you like, then refresh the page to return to the intended appearance of the web page.

Part 1
Part 1 of 2:

Inspecting Elements

  1. 1
    Right-click any webpage element. You can right-click on images, text, backgrounds, or any other element. If you don't have a two-button mouse, left-click while holding Control.
  2. 2
    Click Inspect Element from the drop-down menu. A toolbar should appear at the bottom of your window. A pane will also appear below the toolbar, displaying the page's HTML code.
    Advertisement
  3. 3
    Identify the toolbars and panes. When you click Inspect Element, several panes will open at the bottom of your window. Here's a breakdown of their uses and names:[1]
    • The top row is the Toolbox Toolbar. This has several developer tools, but we're interested in Inspector on the left. Keep this selected (highlighted in blue) for this entire guide.
    • Below the toolbar, there's a single Breadcrumbs row of HTML elements, showing the full path relating to the selected element.
    • The pane below this row shows the HTML tree or "Markup View" of the page. The HTML for the element you selected is highlighted and centered in this pane.
    • The pane to the right displays the CSS stylesheet for this page.
  4. 4
    Select another element. Once the toolbar is open, selecting another element is easy. Here are three ways to do it:
    • Hover over a line of HTML to highlight the corresponding element (requires Firefox 34+).[2] Click the HTML to select that element.
    • Click the Select Element tool on the far left of the toolbar: the icon is a cursor over a square. Move your cursor over the page to highlight elements, then click to select an element.
  5. 5
    Navigate through the code. Click anywhere in the HTML pane. Use the left and right arrows on your keyboard to move through the code (requires Firefox 39+).[3] This is useful for elements too small to select by hand.
    • Grey HTML relates to elements not displayed on the page. This includes comments, certain nodes such as <head>, and elements that have been hidden with the CSS display property.[4]
    • Click the arrow to the left of containers to expand or hide its contents. To expand all contents, hold Alt or option while clicking.[5]
  6. 6
    Search for an element. Look for the search bar (magnifying glass icon) on the far right of the Breadcrumbs row. Click this to expand it, then type in the HTML code you're looking for. As you type, a popup will appear listing matching elements. Click on one to select that element and scroll the HTML pane to its code.
  7. Advertisement
Part 2
Part 2 of 2:

Editing the HTML

  1. 1
    Refresh the page to start over at any time. If you're new to web developer tools, understand that they do not make any permanent changes. Your edits will only be visible on your screen, and only until you close the page or refresh it. Don't hesitate to experiment even if you're not sure what will happen.
  2. 2
    Double click the HTML to edit text. Double click a line of HTML. Type in the new text and press enter to save your changes.
  3. 3
    Click and hold a breadcrumb for more options. Remember, the Breadcrumb toolbar is sandwiched between the full HTML tree and the upper toolbar. Click and hold on any of the elements in this row to open an extensive menu. Here's an incomplete guide to these options:[6]
    • "Edit as HTML" makes the node and all its contents editable in the HTML tree, instead of having to edit each line individually.
    • "Copy Inner HTML" copies all the contents of the node, while "Copy Outer HTML" copies the node as well (such as <div> or <body>
    • "Paste →" leads to several options for where to paste, such as before this node or after the first child of the node.
    • :hover, :active, and :focus change the appearance of the element when the user interacts with it. The exact effect is determined by the CSS stylesheet (editable from the right-hand pane).
  4. 4
    Drag and drop. To rearrange elements in the code, click and hold the HTML until a dashed line appears. Move it up or down the tree and let go when the dashed line is in the desired place.
    • This requires Firefox 39 or later.[7]
  5. 5
    Close the developer toolbar. To close all of these fancy windows, just press the X in the far right corner of the toolbar, above the CSS pane.
  6. Advertisement

Community Q&A

  • Question
    What are the numbers given after 'IMG' on an image in Inspector?
    Community Answer
    Community Answer
    Most likely, they are with width and height attributes.
Advertisement

About This Article

Tested by:
wikiHow Technology Team
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 24 people, some anonymous, worked to edit and improve it over time. This article has been viewed 135,008 times.
How helpful is this?
Co-authors: 24
Updated: April 8, 2021
Views: 135,008
Categories: Firefox
Advertisement