ScreenshotNeo

BlogGuides

Common Web Development Mistakes and How to Avoid Them

Avoid common web development mistakes with practical checks for accessibility, responsive layouts, performance, and security.

By the ScreenshotNeo team4 October 20267 min read

Many web development problems come from habits that are easy to miss: relying on visual appearance instead of semantic behavior, designing for one screen size, optimizing without measurement, or trusting data because it came from the browser. Avoid them by building in checks for accessibility, responsive behavior, performance, and security throughout development.

These are evidence-backed areas to review, not a ranked list of the most frequent failures. Which risks matter most depends on your users, stack, data, and application.

1. Treating accessibility as a finishing touch

A page can look polished and still be difficult or impossible to use with a keyboard or assistive technology. Semantic HTML gives browsers and assistive technologies meaningful structure and expected behavior. CSS and JavaScript can undo those benefits when they obscure focus, change reading order, or replace native interaction without reproducing it.

How to avoid it

  • Use elements according to their meaning: headings for page structure, buttons for actions, links for navigation, and labels associated with form controls.
  • Give informative images useful alternative text. Use an empty alt value for decorative images so they are not announced unnecessarily.
  • Keep DOM and reading order logical. Do not rely on visual positioning to explain a sequence that the document order does not convey.
  • Make every interactive control usable by keyboard and keep focus visible. Test Tab, Shift+Tab, Enter, Space, and Escape where relevant.
  • Provide useful form errors: identify the field, explain the problem, and suggest a correction. Do not communicate errors by color alone.
  • Check text enlargement and zoom. At 200% enlargement, content should remain readable without clipping or unnecessary horizontal scrolling.
  • Respect user preferences for motion where animation could cause discomfort, and ensure motion is not required to understand or operate the page.

For example, a clickable <div> does not automatically gain the keyboard behavior or semantics of a button. Prefer <button type="button">Save</button> for an action. Use a link when activating it navigates to another location.

Run automated accessibility checks as one input, then manually use the page with a keyboard and, where appropriate, assistive technology. Automated checks cannot establish that the reading order, instructions, or interaction make sense to people.

See the W3C WAI developer tips and MDN guidance on CSS, JavaScript, and accessibility.

2. Building a layout for one screen size

A fixed-width page may force horizontal scrolling on a narrow screen and leave excessive empty space on a wide one. Responsive design is an approach to adapting content and layout across a range of viewport sizes, resolutions, and zoom levels, not a single framework or breakpoint.

How to avoid it

  • Include the viewport declaration in the document head: <meta name="viewport" content="width=device-width, initial-scale=1">.
  • Prefer flexible sizing and layout tools such as CSS Grid, Flexbox, percentages, and sensible maximum widths over fixed page-wide dimensions.
  • Use media queries when the content or layout needs to change at a particular range, rather than targeting named devices.
  • Make images and other media fit their containers, and provide appropriately sized image sources when useful.
  • Test representative narrow and wide viewports, longer-than-usual text, zoom, and content that is added dynamically.

Look for clipped controls, overlapping content, unreadably narrow columns, and horizontal scrolling that makes primary content hard to reach. A screenshot at a single desktop width cannot reveal all of these issues. MDN’s responsive design guide explains the underlying approach.

3. Optimizing performance without measuring

Performance includes objective loading and runtime behavior as well as perceived responsiveness and smoothness. A single audit score is not a guarantee of a good experience, and an optimization should address an observed bottleneck rather than a guess.

How to avoid it

  1. Measure representative pages and interactions. Use browser developer tools to profile loading, scripting, rendering, and runtime work.
  2. Reduce unnecessary JavaScript and avoid shipping code a page does not need.
  3. Resize and compress media appropriately; consider lazy loading media that is initially offscreen.
  4. Use repeatable synthetic checks to catch short-term regressions. Use real-user monitoring to understand longer-term behavior for actual visitors; the two methods answer different questions.
  5. Set a performance budget when it fits the project, and investigate regressions rather than accepting a slowly growing payload by default.

MDN lists tools including Firefox Developer Tools, PageSpeed Insights, Lighthouse, WebPageTest, and Chrome User Experience Report. They serve different measurement purposes. Compare results under consistent conditions and use more than one source of evidence where the decision warrants it.

See MDN performance best practices and its web performance overview.

4. Trusting data because it came from the browser

Browser input and integration data are untrusted. That includes form fields, API responses, third-party services, browser storage, hidden fields, cached responses, and values returned by internal services. Client-side validation can give users faster feedback, but users can bypass it, so it cannot enforce security-sensitive rules.

How to avoid it

  • Validate data on the server for both syntax and meaning. Check that values are in the permitted range and make sense for the operation.
  • Check authorization independently for each protected action and resource. A valid input is not proof that the requester is allowed to use it.
  • Use parameterized SQL queries instead of building query strings from user input.
  • Encode output for its destination context. HTML text, HTML attributes, URLs, and JavaScript have different handling requirements; a generic sanitization step is not a universal substitute.
  • Avoid inserting untrusted strings with innerHTML. For plain text, use a text-setting API such as textContent.
  • Do not rely on hidden fields, disabled controls, or client-side role checks to protect sensitive operations.

OWASP’s frontend security guidance covers untrusted data and unsafe browser-side assumptions. Its input validation guidance explains server-side validation, output encoding, parameterized queries, and authorization as separate concerns.

5. Treating a security checklist as a substitute for risk-based testing

A checklist can help a team remember recurring checks, but it cannot cover every application’s threats and workflows. Testing should reflect what the application does, what data it handles, and what an attacker could gain.

OWASP describes its Web Security Testing Guide as a methodology and reference for practical testing techniques, not a rigid checklist or compliance standard. Adapt testing to the system’s threat model, risk tolerance, and development practices. Consider identity, authentication, authorization, sessions, input handling, error handling, cryptography, business logic, and workflow security where relevant.

6. A practical review before release

  1. Operate the interface without a mouse. Confirm the focus order is understandable, focus remains visible, and controls can be activated and dismissed with the keyboard.
  2. Check structure and forms. Review heading order, labels, image alternatives, instructions, and the clarity and placement of error messages.
  3. Resize and zoom. Try representative narrow and wide widths, longer content, and enlarged text. Look for clipping, overlap, and hard-to-reach content.
  4. Measure a real page flow. Profile the page and its important interactions, then address the measured bottleneck. Keep a repeatable check for regressions where practical.
  5. Trace untrusted data. Follow user and integration values from entry to storage, query, and output. Confirm server-side validation, authorization, parameterized queries, and context-appropriate output handling.
  6. Choose tests by risk. Add focused checks for the important roles, data, and workflows instead of treating a generic list as complete.

Or skip the browser setup

For a screenshot used in responsive reviews, bug reports, or documentation, you can capture a page with a local browser tool, or use ScreenshotNeo, a website screenshot API and MCP server for developers. Its one-call API returns an image or PDF; see the ScreenshotNeo API documentation for parameters and options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie banners, newsletter popups, and chat widgets are removed before the shot; each step can be turned off.
  • Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing. Responses identify the page verdict and billing status in headers.
  • An MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs.
  • The free plan includes 1,000 screenshots a month with no card. Paid plans start at $5 for 3,000 screenshots.

Sign up for 1,000 free screenshots a month, with no card.

Common troubleshooting questions

Keyboard users cannot reach or activate a control

Likely cause: A non-interactive element was used as a control, focus was hidden, or a JavaScript handler only responds to pointer input. Fix: Use a native button or link where appropriate, restore a visible focus style, and test the interaction with a keyboard.

The page scrolls sideways on a phone

Likely cause: A fixed-width element, long unbroken content, or oversized media exceeds the viewport. Fix: Inspect the overflowing element, use flexible sizing, and test narrow widths and long content.

An optimization made the page slower

Likely cause: The change targeted the wrong bottleneck or added runtime work or payload. Fix: Profile before and after under comparable conditions, then keep the change only if it improves the relevant user-facing behavior.

Client-side validation passes but invalid data is accepted

Likely cause: The server trusts browser checks or hidden values. Fix: Repeat validation on the server and perform authorization checks for the requested action.

Untrusted content runs as markup or script

Likely cause: Data was inserted into an HTML context without the correct handling. Fix: Avoid innerHTML for plain text; use safe text APIs and context-appropriate output encoding for other destinations.

FAQ

Should every project use the same breakpoint values?

No. Choose breakpoints where the content or layout stops working well, then verify the result across a range of sizes.

Can an accessibility scanner certify a page?

No single automated scan establishes that a page works for everyone. Combine automated checks with keyboard use and appropriate manual review.

Does a good performance audit score guarantee a fast experience?

No. Audit conditions and metrics provide evidence, while actual experience varies by device, network, page, and interaction. Use field data and repeatable lab checks for their different strengths.

Is input validation enough to secure a web application?

No. Validation is one part of handling data. Authorization, safe queries, context-aware output encoding, and risk-based testing address different failure modes.