← 返回
数据分析 中文

HTML

Avoid common HTML mistakes — accessibility gaps, form pitfalls, and SEO oversights.
避免常见HTML错误——无障碍缺失、表单陷阱及SEO疏忽。
ivangdavila
数据分析 clawhub v1.0.0 1 版本 99805.5 Key: 无需
★ 4
Stars
📥 2,486
下载
💾 329
安装
1
版本
#latest

概述

Layout Shift Prevention

  • width and height on even with CSS sizing — browser reserves space before load
  • aspect-ratio in CSS as fallback — for responsive images without dimensions

Form Gotchas

  • autocomplete attribute is specific — autocomplete="email", autocomplete="new-password", not just on/off
  • + required for radio/checkbox groups — screen readers announce the group label
  • inputmode for virtual keyboard — inputmode="numeric" shows number pad without validation constraints
  • enterkeyhint changes mobile keyboard button — enterkeyhint="search", enterkeyhint="send"

Accessibility Gaps

  • Skip link must be first focusable — before nav
  • or scope="row" — without scope, screen readers can't associate headers
  • aria-hidden="true" hides from screen readers — use for decorative icons, not interactive elements
  • role="presentation" on layout tables — if you must use tables for layout (you shouldn't)

Link Security

  • target="_blank" needs rel="noopener noreferrer"noopener prevents window.opener access, noreferrer hides referrer
  • User-generated links need rel="nofollow ugc"ugc tells search engines it's user content

SEO Meta

  • prevents duplicate content — self-referencing canonical on every page
  • og:image needs absolute URL — relative paths fail on social platforms
  • twitter:card values: summary, summary_large_image, player — not arbitrary

Common Oversights

  • element for modals — built-in focus trap and escape handling
  • + for accordions — no JS needed, accessible by default
  • Void elements don't need closing slash — not in HTML5, though both work

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 19:50 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 56,939
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,356 📥 318,119
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 164 📥 59,911