Common Fixes

Debug the usual web design problems.

Use this page when something breaks and you need a calm sequence: identify the symptom, check the likely causes, fix one thing, then verify in the browser.

01

Name the symptom

Say what is happening before changing code. Broken images, missing CSS, and dead buttons have different paths.

02

Check the browser

Use DevTools, the Console, the Network tab, and responsive mode. The browser is usually telling you something.

03

Fix one thing

Make one change, save, refresh, and test again. Random edits make bugs harder to understand.

Troubleshooting

CSS is not loading

The HTML appears in the browser, but the page looks unstyled or only partly styled.

Likely Causes

  • The stylesheet path in the link tag is wrong.
  • The CSS file name or folder name does not match exactly.
  • The link tag is outside the head or missing rel="stylesheet".
  • The file was changed locally but not committed, pushed, or deployed.

Check First

  • Open DevTools and check the Network tab for a missing CSS file.
  • Compare the HTML file location with the CSS file location.
  • Confirm the path uses forward slashes, not Windows backslashes.
  • Confirm capitalization matches the actual file name.

Fix It

  1. Move the CSS file into the expected folder or update the href path.
  2. Use a simple path first, such as styles.css when the file sits next to index.html.
  3. Save, refresh, commit, push, and check the live URL after GitHub Pages updates.

Related Lessons

Related Projects

Troubleshooting

Image is not showing

The image area is empty, broken, or works locally but disappears after publishing.

Likely Causes

  • The img src path points to the wrong folder.
  • The image file was not moved into the project folder.
  • The file name extension is different, such as .jpg instead of .png.
  • The live site is case-sensitive even if the local computer is forgiving.

Check First

  • Right-click the broken image area and inspect the src path.
  • Find the image file in the project folder and compare the exact name.
  • Open the image directly from the browser if possible.
  • Check whether the image is too large and slow to load.

Fix It

  1. Place images in a clear folder such as images/.
  2. Update the src path to match the folder and file exactly.
  3. Add useful alt text after the image loads correctly.
  4. Optimize large images before final submission.

Related Lessons

Troubleshooting

GitHub Pages is not updating

The local site looks correct, but the public GitHub Pages site still shows an older version.

Likely Causes

  • The latest changes were not committed.
  • The commit was created but not pushed.
  • GitHub Pages is building from a different branch or folder.
  • The browser is showing a cached version of the page.

Check First

  • Open GitHub Desktop and confirm there are no uncommitted changes.
  • Check whether the button says Push origin.
  • Open the GitHub repository and confirm the changed files are visible online.
  • Go to repository Settings, then Pages, and confirm the publishing source.

Fix It

  1. Commit the current changes with a clear message.
  2. Push the commit to GitHub.
  3. Wait a few minutes, then refresh the Pages URL.
  4. Try a hard refresh or private window if the repository shows the latest files.

Related Lessons

Troubleshooting

Mobile layout is overflowing

The page creates sideways scrolling, clipped content, or cards that do not fit on small screens.

Likely Causes

  • A container has a fixed width that is wider than the viewport.
  • Images or embedded media are not constrained with max-width.
  • A flex or grid layout does not wrap or change at smaller widths.
  • Long words, URLs, or code snippets are not allowed to wrap.

Check First

  • Use responsive design mode and slowly shrink the viewport.
  • Look for the first width where the layout breaks.
  • Inspect the widest element and check width, min-width, and grid settings.
  • Temporarily outline elements to see which one is forcing the page wide.

Fix It

  1. Replace fixed widths with max-width and flexible units.
  2. Set images and media to max-width: 100%.
  3. Use flex-wrap, responsive grid columns, or media queries when the content needs a new layout.
  4. Allow long text to wrap when needed.

Related Lessons

Related Projects

Troubleshooting

JavaScript is not running

Buttons, toggles, menus, or interactive elements appear on the page but do nothing.

Likely Causes

  • The script path is wrong.
  • The script runs before the HTML exists.
  • The selector does not match the element in the HTML.
  • There is a JavaScript error earlier in the file.

Check First

  • Open the Console and read the first error message.
  • Check the Network tab to confirm the JavaScript file loads.
  • Confirm the selector in JavaScript matches the class, id, or data attribute in HTML.
  • Add a temporary console.log to verify the event listener runs.

Fix It

  1. Use a correct script src path.
  2. Load the script with defer or place it near the end of the body.
  3. Use stable selectors such as data attributes for interactive hooks.
  4. Fix the first console error before chasing later behavior.

Related Lessons

Related Projects

Troubleshooting

Form is hard to use or fails accessibility checks

Fields are confusing, labels are not announced correctly, or keyboard users cannot complete the form smoothly.

Likely Causes

  • Inputs do not have connected label elements.
  • Placeholder text is being used as the only label.
  • Required fields or errors are only communicated visually.
  • Focus states are missing or difficult to see.

Check First

  • Click each label and confirm it focuses the matching field.
  • Tab through the entire form using only the keyboard.
  • Check whether required fields are clear before submission.
  • Confirm errors and instructions are written in text, not color alone.

Fix It

  1. Connect labels with matching for and id values.
  2. Use appropriate input types such as email, text, checkbox, and textarea.
  3. Keep labels visible even when placeholders are present.
  4. Add clear focus styling and readable helper or error text.

Related Lessons

Related Projects

Troubleshooting

Focus or keyboard behavior is broken

Links, buttons, menus, or interactive elements are hard to reach or use without a mouse.

Likely Causes

  • Interactive behavior was built with non-interactive elements.
  • Focus styles were removed or hidden.
  • The visual order and keyboard order do not match.
  • A menu or modal opens without managing focus.

Check First

  • Put the mouse away and use Tab, Shift+Tab, Enter, Space, and Escape.
  • Watch where focus goes and whether it is visible.
  • Confirm clickable things are real links or buttons.
  • Check whether opened content can be closed with the keyboard.

Fix It

  1. Use links for navigation and buttons for actions.
  2. Restore or add visible focus styles.
  3. Avoid changing visual order in ways that confuse keyboard order.
  4. Add keyboard handling for menus, modals, and custom interactions.

Related Lessons