Lesson 26 / DevTools
DevTools for Designers
Use browser DevTools as a live design microscope to inspect layout, spacing, typography, responsive behavior, accessibility, assets, and performance clues.
Course Role
Studio Support
Best during work sessions, critique, debugging, project planning, or final polish.
Teacher Notes / In-Class Use
Demo Live
- Walk through the interactive demo before students start changing their own project files.
- Connect the demo back to the first goal: Inspect HTML and CSS in the browser without guessing
Try In Class
- Inspect a heading and identify its final `font-size`, `line-height`, and margin.
- Have students make one visible change, save, refresh, and explain what changed.
Submit Or Check
- Ask students to show the work in the browser, not only in the editor.
- Have students commit their progress with a clear message when the checkpoint is stable.
Watch For
- Students copying code without checking file paths, spelling, or capitalization.
- Visual changes that work locally but break when the project is published.
Learning Goals
- Inspect HTML and CSS in the browser without guessing
- Use the box model, computed styles, and live CSS editing to refine design decisions
- Test responsive layouts, Flexbox/Grid overlays, accessibility names, and loaded assets
- Move temporary DevTools experiments back into real project files
Interactive Demo
How to use this demo.
Use the demo as a small lab. Change one thing, observe the result, then connect it back to your own project.
What To Try
- Inspect the hero, card, and link, then adjust padding and accent color.
- Compare a temporary inspector change with the generated CSS rule.
What Changes
- The selected element gets an inspected outline and temporary CSS changes.
- The code sample updates with the rule students would copy into their stylesheet.
What To Notice
- DevTools is safest as a testing space before committing CSS to the project.
- Temporary browser changes disappear unless the final rule is added to the CSS file.
Apply It
- Use DevTools to test one spacing or color change, then copy the winning rule into the project CSS.
Interactive Demo
DevTools Inspector Lab
Select an element and test temporary CSS changes the way you would in the browser inspector.
Study Spots
Find a focused place to work
Library Loft
Quiet seating, outlets, and long tables.
View detailsInspect the hero, then adjust a rule.
.hero { padding: 24px; } This demo uses extra JavaScript for teaching. The code sample shows the pattern to practice. View full demo source.
DevTools Is a Design Tool
DevTools lets you see the page the way the browser sees it. It is useful for debugging, but it is also one of the best tools for design refinement.
Use it to inspect spacing, type, color, layout, image size, responsive behavior, accessibility names, and which CSS rule is actually winning.
Changes made in DevTools are temporary. If a change works, copy it back into your real CSS, HTML, or JavaScript file before refreshing.
Core Panels
| Panel or Tool | Use It For | Student Example |
|---|---|---|
| Elements | Inspecting HTML, CSS rules, layout, and the box model. | Find why a card has too much padding. |
| Computed | Seeing the final value the browser uses after the cascade. | Confirm the actual font size or color. |
| Console | Reading JavaScript errors and quick messages. | Find why a menu button stopped working. |
| Network | Checking loaded files, image sizes, fonts, and missing assets. | Find a huge image or missing stylesheet. |
| Device Toolbar | Testing responsive widths and touch-sized layouts. | Preview a site at phone and tablet sizes. |
| Lighthouse | Auditing accessibility, performance, SEO, and best practices. | Run a final project check after manual review. |
Elements Panel Workflow
Use this workflow when something looks wrong but you are not sure which rule controls it.
| Step | Action |
|---|---|
| Select | Use the element picker and click the exact element on the page. |
| Read | Look at the HTML, classes, and CSS rules in the Styles panel. |
| Compare | Notice crossed-out rules, inherited rules, and which selector wins. |
| Test | Change one value in DevTools and watch the page update live. |
| Save | Copy the working change back into the real stylesheet. |
.card {
padding: 1rem;
border: 1px solid currentColor;
}
/* Try changes live in DevTools, then copy the final version into your CSS file. */ Inspect the Box Model
The box model view shows the actual content size, padding, border, and margin for the selected element. This is the fastest way to understand spacing problems.
| Question | Where To Look |
|---|---|
| Why is there space inside the card? | Check padding in the box model. |
| Why is there space outside the button? | Check margin in the box model. |
| Why is the element wider than expected? | Check content width, padding, border, and box-sizing. |
| Why does a rule not apply? | Look for crossed-out styles or a stronger selector. |
Computed Styles
The Computed panel shows the final values after the cascade, inheritance, media queries, and browser defaults are resolved.
- Use it to confirm the real
font-size,color,line-height,display, andwidth. - Expand a computed value to see which CSS rule created it.
- Use it when several selectors are fighting over the same property.
Responsive Testing Workflow
The device toolbar is not a replacement for real-device testing, but it is an excellent first pass for finding layout problems.
| Step | Action |
|---|---|
| Open | Turn on the device toolbar in DevTools. |
| Resize | Drag slowly from wide to narrow and watch where the layout breaks. |
| Check navigation | Confirm menus, links, and buttons remain usable. |
| Check content | Look for overlapping text, cropped images, and tiny tap targets. |
| Check overflow | Look for horizontal scrolling or elements wider than the viewport. |
| Fix | Adjust CSS in DevTools, then move the final rule into your stylesheet. |
Flexbox and Grid Overlays
DevTools can draw visual overlays for Flexbox and Grid. These overlays help you see tracks, gaps, alignment, wrapping, and the space each layout system controls.
- Use Flexbox overlays to inspect direction, wrapping, and alignment.
- Use Grid overlays to inspect columns, rows, gaps, and grid areas.
- Turn overlays on when a layout feels close but spacing or alignment is hard to see.
Accessibility Inspection
DevTools can help you inspect how an element is exposed to assistive technology. This is especially useful for checking buttons, links, form labels, images, and custom controls.
Automated accessibility tools support your review, but they do not replace keyboard testing or human judgment.
| Check | What To Look For |
|---|---|
| Accessible name | Does the button, link, image, or input have a clear name? |
| Role | Is the element exposed as the correct type of control? |
| Focus | Can the element receive keyboard focus when it should? |
| Contrast | Does text meet contrast expectations in Lighthouse or an accessibility tool? |
| Alt text | Does the image communicate useful meaning or stay decorative with empty alt=""? |
Network Panel for Assets
The Network panel shows what the browser requested and how large those files are. Use it for missing files, oversized images, font loading, and slow pages.
| Signal | What It Means |
|---|---|
404 status | The file path is wrong or the file was not published. |
| Large image file | The image may need resizing or compression. |
| Many font files | The page may be loading too many font families or weights. |
| Slow JavaScript | A script or third-party embed may be delaying the page. |
Design Review Checklist
Use this quick pass when polishing a page. Inspect one real example of each item instead of only looking at the page from a distance.
- Inspect one heading and confirm its font size, line height, margin, and hierarchy.
- Inspect one button and confirm hover, focus, padding, and contrast.
- Inspect one card and check image ratio, padding, border, and spacing.
- Inspect one layout and turn on the Flexbox or Grid overlay.
- Inspect one image in the Network panel and check its file size.
- Inspect one form control or button and confirm its accessible name.
- Resize the page and identify the first width where the layout needs help.
Common Mistakes
| Mistake | Better Habit |
|---|---|
| Editing in DevTools and forgetting to save | Copy working changes into your real files immediately. |
| Only testing preset device sizes | Drag the viewport slowly and watch every width in between. |
| Ignoring crossed-out CSS | Use crossed-out rules to understand the cascade. |
| Running Lighthouse first | Inspect and manually test first, then use Lighthouse as support. |
| Guessing image size from appearance | Check actual file size and dimensions in the Network panel. |
Checkpoint
Before moving on, make sure these feel true.
- I can inspect an element and identify which CSS rule is affecting it.
- I can test responsive widths in the browser.
- I can use the network panel to find missing files.
Practice
- Inspect a heading and identify its final
font-size,line-height, and margin. - Inspect a button and test one temporary color, padding, or focus-style change.
- Use the box model view to explain the spacing around one card.
- Use the device toolbar to find one responsive issue or confirm none appears.
- Turn on a Flexbox or Grid overlay for one layout in your project.
- Open the Network panel and identify the largest image or asset on the page.
- Inspect one button, link, image, or form input for its accessible name.