Debugging CSS

Overview

Inspect Element

Probably the best way to open DevTools if you mainly use it to debug CSS.

Inspect Me!

Detour: Docking

  1. Open the Command Menu
    • Control+Shift+P
    • Command+Shift+P (Mac)
  2. Run the Dock To Bottom, Dock To Right, or Undock Into Separate Window command

The Styles pane

  1. Select element in the DOM Tree to view its CSS in the Styles pane
  2. Filter as needed

Shows all CSS declarations for the selected element. Useful for debugging the cascade order.

Debug My Background Color

The Computed pane

Don't need to see the cascade? Try the Computed tab.

Navigating the DOM Tree

Since you might inspect thousands of elements over your career, it's worth trying out the different workflows and finding out which one is best for you.

Detailed Tooltip in Inspect Mode

Introduced in January 2019 (Chrome 73).

Animations

Photo credit: http://www.oocities.org/televisioncity/studio/3371/pictures.html