Skip to content
🌐

Web 错误

50 个错误

网页开发常见错误排查手册:覆盖 HTML 结构、CSS 样式与浏览器兼容性问题的定位与修复。

50 / 50

  1. 1

    Broken 镜像

    你的 `<img>` 标签点 到 file 那个 doesn't exist, 是 in 错误位置, or 失败到 加载 — 浏览器 shows broken 镜像 icon.

  2. 2

    CSS Selector 不 Matching

    你的 CSS 规则有 否副作用因为 selector doesn't match 任何元素 — or 更多特定规则 overrides 它 in cascade.

  3. 3

    404 不找到

    page or resource 你 requested doesn't exist at 那个 URL — path 是错误, file 是移除, or route isn't 配置.

  4. 4

    Mixed 内容

    你的 secure (HTTPS) page 是 trying 到加载 insecure (HTTP) resource, 哪个浏览器块 for security reasons.

  5. 5

    CORS 错误

    浏览器 blocked 你的 cross-原点请求因为服务器 didn't 发送正确 CORS 请求头到 permit 它.

  6. 6

    JavaScript 不加载

    你的 script 标签点 到 file 那个 doesn't exist, 有语法错误, or 是 blocked 从加载 — page's interactivity breaks.

  7. 7

    CSS 不加载

    你的 `<链接>` 标签点 到 CSS file 那个 doesn't exist or 失败到 加载, 所以 page appears unstyled.

  8. 8

    Flexbox 不工作

    你的 flex-方向, justify-内容, or align-项属性是 不工作因为容器是 missing display: flex.

  9. 9

    Z-索引不 工作

    你的 z-索引值 是不 工作因为元素需要位置值 other than 静态 (默认).

  10. 10

    CSS !重要不 工作

    你的 !重要规则是 不 winning 因为 another 规则使用 !重要有 higher specificity, or 规则是 不 matching.

  11. 11

    事件监听器不 Firing

    你的事件监听器是 不 firing 因为元素做 不 exist 当监听器是 attached, or 事件 name 是错误.

  12. 12

    JSON Parse 错误

    JSON.parse 失败因为输入字符串是 不有效 JSON — 通常 due 到单个 quotes, trailing commas, or unquoted 键.

  13. 13

    获取 Network 错误

    你的获取请求是 failing 使用 TypeError — 服务器是 unreachable, URL 是错误, or CORS 是 blocking 请求.

  14. 14

    Cumulative 布局 Shift

    元素 on 你的 page move 之后初始渲染因为它们的维度是 不 reserved — 镜像, 字体, or ads 加载 and 推送内容围绕.

  15. 15

    CSS Specificity War

    你的 CSS 规则是 是 overridden 通过更多特定规则, and 你 cannot figure out 为什么的样式是 不 applying.

  16. 16

    Responsive 布局 Broken

    你的 page 做不 adapt 正确地到 不同 screen 大小 — 内容 overflows, 元素是 也小, or 布局 breaks.

  17. 17

    HTML 表单 Validation 不工作

    你的必需, 模式, or 类型-based validation 是不 工作因为表单 or 输入是 misconfigured.

  18. 18

    DOM 元素是 空

    你的 JavaScript tries 到 access DOM 元素那个做 不 exist, resulting in 'Cannot 读取属性的 空'.

  19. 19

    CSS 不 Applying in Print

    你的 page looks fine on screen 但 prints 不正确地因为 screen 样式做 不 apply 到 print media 通过默认.

  20. 20

    异步 Script Execution 顺序

    你的异步 scripts 执行 as soon as 它们 download, potentially out 的顺序 — 如果 script B depends on script , B 可能运行之前 .

  21. 21

    Flexbox 内容 Overflow

    你的 flex 项是 shrinking 也 much or overflowing 容器因为 flex defaults cause unexpected sizing behavior.

  22. 22

    网格项 不 Placing 正确地

    你的网格项 是 in 错误单元格 or spanning 不正确地因为网格-列 or 网格-行值 是错误.

  23. 23

    自定义字体不 加载

    你的自定义字体是 不加载因为字体 file path 是错误, 格式是 不正确, or 字体-face declaration 有错误.

  24. 24

    Iframe 内容 Blocked

    你的 iframe 是空白因为目标 site 发送 X-Frame-Options or CSP 请求头那个 prevent embedding.

  25. 25

    CSS Transition 不 Animating

    你的 transition 是不 工作因为属性是 不 transitionable, duration 是 missing, or 值更改是 不 triggered.

  26. 26

    localStorage Quota Exceeded

    你的 localStorage setItem call 失败因为 storage 限制 (通常 5-10MB) 有是 reached.

  27. 27

    SSL Certificate 错误

    你的 HTTPS site shows security 警告因为 SSL certificate 是无效, expired, or misconfigured.

  28. 28

    浏览器 Memory Leak

    你的 web page 获取 slower over 时间因为 JavaScript 是持有引用到 对象那个应该是 garbage collected.

  29. 29

    SEO Duplicate 内容

    你的 site 有相同内容 accessible 通过多个 URLs, confusing 搜索 engines 关于哪个 version 到索引.

  30. 30

    WebSocket 连接失败

    你的 WebSocket 连接失败到 打开因为服务器是 不运行, URL 是错误, or protocol 是 mismatched.

  31. 31

    Service Worker 注册失败

    你的 service worker 注册失败——Promise 被 reject,离线功能不可用。

  32. 32

    地理位置权限被拒绝

    用户阻止了位置访问——错误回调收到 PERMISSION_DENIED,不返回任何位置。

  33. 33

    Clipboard API 不可用

    你调用了 navigator.clipboard.writeText 但 clipboard 为 undefined——页面不在安全上下文或浏览器不支持。

  34. 34

    Intersection Observer 无效的 root

    你把 null 或已脱离 DOM 的元素作为 observer root——交叉状态永不报告。

  35. 35

    刷新后 History API 状态丢失

    你把数据存入 pushState——刷新后 history.state 为 null,应用丢失数据。

  36. 36

    FileReader readAsText 编码错误

    你对非 UTF-8 文件调用 readAsText 却未指定编码——结果出现乱码字符。

  37. 37

    AbortController 已中止的 fetch

    你在 fetch 落定前调用了 controller.abort()——Promise 以 AbortError reject,永远收不到响应。

  38. 38

    HTML 未闭合标签破坏布局

    你忘了闭合 <div>——浏览器在猜测处闭合,常把后续兄弟元素吞进错误容器。

  39. 39

    CSS 无效属性值被忽略

    你写了 width: 100(无单位)或 color: purpl——浏览器忽略该声明并使用默认值。

  40. 40

    HTML 重复的 ID 属性

    你在两个元素上用了 id="header"——getElementById 只返回第一个,样式可能应用到错误元素。

  41. 41

    CSS 缺少闭合花括号

    你漏了闭合 }——下一条规则的选择器被当作损坏规则的属性,二者都被忽略。

  42. 42

    HTML 无效的属性值

    你写了 value="say "hi""——内层引号提前闭合属性,剩余部分成为非法标记。

  43. 43

    CSS 未知厂商前缀被忽略

    你写了 -webkit-flexbox(旧草案名)——现代浏览器忽略它,属性永不生效。

  44. 44

    CSS 外边距合并的意外

    你设 margin-bottom: 20px、下一元素 margin-top: 30px——间距是 30px(非 50px),因为外边距合并。

  45. 45

    事件委托 target 不匹配

    你在父元素绑了监听并检查 event.target——但 target 是深层子元素,不是你绑定的父元素。

  46. 46

    表单提交默认行为未阻止

    你处理了 submit 却忘了 e.preventDefault()——浏览器执行整页刷新,JS 处理器的工作丢失。

  47. 47

    CSS 百分比高度无父高度

    你设 height: 100% 但父元素 height: auto——百分比无参照,元素仅与内容同高。

  48. 48

    input value 属性与属性不同步

    你在用户输入后读 getAttribute('value')——返回初始默认值而非当前输入。

  49. 49

    滚动位置被意外恢复

    刷新后页面跳到旧滚动位置——而你的 SPA 期望从顶部开始。

  50. 50

    CSS 层叠上下文隔离 z-index

    你给子元素设 z-index: 9999 但它仍在模态之下——父元素创建了新层叠上下文,隔离了子元素的 z-index。

← 返回错误