Browsers Are Our Imperfect Venue#
There is no single best browser; they are all kind of differently bad, in different ways.
-
Chrome DevTools
We’ll be using these. -
Safari Web Development Tools
Got some long-overdue love way back in Sonoma, but little since then. -
Firefox DevTools User Docs
Spiritual successor to Firebug, 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 DevTools—though Safari and Firefox have their own versions, too. Much of this is just preference, but ultimately you’ll want to see what your visitors are seeing.
You have always been able to
You’ll often hear people (Michael) call it the Web Inspector, or just The Inspector. It’s going to be your best (Web) friend, showing you everything that the browser has parsed to display your pages.
Inspecting Pages#
In Chrome, you can bring them up by right-clicking on any element/part of a page and clicking
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:
You can also hit


The Customize
Elements Panel#
The top part of the tools shows us the DOM—you can expand/collapse all the nested HTML elements on the opened page.
View and change the DOM
View and temporarily edit the rendered page HTML.
The first
The second
The
Handy tip:
Styles Tab#
The area below is for styles. It shows whatever CSS properties apply to the element you have selected above, in the DOM/Elements panel.
View and change CSS
See what styles are applied, and temporarily edit them.
These are ordered (somewhat unintuitively) in a more-specific, reverse-cascade sequence—inline styles at the top, external and internal stylesheets, then user-agent styles at the bottom—with any cascading/conflicting rules crossed out, as you go down.
On the right, you can see the sum Computed (or rendered) values of all the rules that apply—regardless of where they come from. These represent exactly what the browser is showing to you for the selected element.
You can type specific CSS properties/values into both
You can make changes in Elements or Styles, and the edits will be immediately visible on the page as if you had edited the source files!
It’s useful to try things out quickly—and diagnose where problems/conflicts arise.
Device Mode#
It’s always best to check our work on other screen-sizes/actual devices, but we can also emulate them quickly with device mode. Enable it with the little phone/laptop
Simulate mobile devices with device mode
Approximate how your page looks/behaves on a mobile device.

Be sure to hard-refresh with
Dimensions: Responsive#
Generally, use the
The Preview Zoom also allows you to approximate views larger than your current screen! You can specify larger dimensions, and it will scale down to show the entire viewport. This is great for developing on a laptop—it won’t be precise, but it’ll give you some idea of big screens.

The

The
Rendering Tab#
Beyond checking different devices/screen sizes, we will also want to test other media features. We could actually print a page, or change our OS settings—but the Rendering tab is quicker!
Rendering tab overview
Emulate other media features!
With our DevTools open,

This gives us a number of options to emulate settings and see how our page will behave: prefers-color-schemeprint )prefers-contrastprefers-reduced-motion ,

Print Preview#
When emulating print816px ×1056px96px /inch

Remember that you are not targeting specific devices; you are looking for when your own design/content breaks!
The Console#
The console is used to help you work with JavaScript, by logging messages, warnings, and any errors from your code as it runs. It can also evaluate written/pasted JS, live.
If your tools are already open, you can show the
You can also hit

The Console opened under Elements/Styles.
This area will show any messages logged from your JavaScript with console.log() .
Warnings and errors (like missing files, or bad JS syntax) will also be shown here—usually with clickable
You can also evaluate and try your JavaScript here directly, by typing (with some nice auto-completion) into the bottom of the console—like console.log('Hello, world!')
You can use this to test out parts of your code right away, like document.querySelector('h1') .