Skip to content
engineering workbench.by StudyPort Academy
All errors
browser · DEBUG LIBRARY

The Network tab shows a failed asset, not a CSS mystery

Locate the failed assumption, reproduce it, then repair the cause.

What actually caused it

A layout that is unstyled, a missing image, or a blank page is often a request that never succeeded. The Network tab lists each request with a status, a type, a size, and a timing bar. Status 200 means the browser received a response it considers successful. 304 means a cached copy was reused. 404 means this URL had no resource. A failed or blocked row never received a normal status.

The type and initiator columns tell you whether the request was the document, a stylesheet, a script, or an image, and which tag started it. A 200 response whose type is html when you expected css means the URL pointed at a document, often an error page, and the stylesheet was not applied.

Disable cache while DevTools is open when you are not sure you are seeing the latest file. Caching is a separate question from a wrong path. A failure is also separate: the request may have reached a server that did not permit the page to read it.

Minimal reproduction

A path that does not match the file

<img src="/images/desk.jpg" alt="Reading desk by the window">
<link rel="stylesheet" href="/styles/missing.css">

A 404 image shows the alt text. A 404 stylesheet leaves the HTML unstyled.

The fix

Filter by the type you care about, then read the status before you edit a selector. Fix the URL, the file name, or the server route for a 404. If the row failed before a status, inspect the console message and the request headers rather than guessing at CSS.

Compare the response body when the status is successful and the page is still wrong. An HTML error page with a 200, or a stylesheet that is empty, will not show up as a selector bug. Give images width and height or aspect-ratio once they load so a late or missing file does not collapse the layout.

Point at a resource the server actually has

<img src="/images/desk.jpg" alt="Reading desk by the window" width="640" height="360">
<link rel="stylesheet" href="/styles/site.css">

The status column should be successful before you debug the rules in that file.