DevTools (Web Inspector)
There is no single
-
Chrome DevTools
We’ll be using these. -
Safari Web Development Tools
Got some long-overdue love back inSonoma , but little since. -
Firefox DevTools User Docs
Spiritual successor toFirebug , the first suite.
Many developers use Chrome for its popularity/hegemony, before testing in other browsers. It also arguably has the most robust set of
You have always been able to View Source, from the earliest days/browsers—remember that the open web has
You’ll often hear people (Michael) call it the
Inspecting Pages
In Chrome, you can bring them up by right-clicking on any element/part of a page and clicking Inspect :
You can also hit
By default, you’ll see the tools open on the right side of the page. Depending on how big your screen is, they might be laid out a bit differently—but the basics are usually the same:
The Customize ⋮ button will let you change the side they appear on, or undock the tools out entirely into a separate window—sometimes easier on a laptop/small screen:
Elements Panel
The top part of the tools is
The first ↖ button in the upper-left lets you mouse over on the page, and will then show you that element nested/hierarchically within the DOM.
The second ⿸ button (more about this below) toggles the
The flex /grid badges (pills?) toggle their layout overlays on the page.
Handy tip:
Styles Tab
The area below is for the styles. It shows whatever
These are ordered (somewhat unintuitively) in a
On the right, you can see the sum
You can type specific CSS properties/values into both Filter boxes to quickly narrow things down!
You can make changes in Elements or Styles, and the edits will be immediately visible on the page
It’s useful to try things out quickly—and diagnose where problems/conflicts arise.
Device Mode
Enter
in the upper left of the DevTools:
Generally, use the Responsive mode that lets you type in specific pixel dimensions for width/height. Or you can use the divided bar underneath to quickly jump through common/ballpark widths.
The
Remember that you are not targeting specific devices; you are looking for when your design/content