← 返回
开发者工具
Website
Build fast, accessible, and SEO-friendly websites with modern best practices.
运用现代最佳实践,构建快速、无障碍且SEO友好的网站。
ivangdavila
开发者工具
clawhub
v1.0.0 1 版本 99147.6 Key: 无需
#latest
概述
Website Development Rules
Performance
- Images are the #1 cause of slow sites — use WebP/AVIF, lazy-load below-the-fold, and set explicit width/height to prevent layout shift
- Render-blocking CSS delays first paint — inline critical CSS in
, defer the rest - Third-party scripts (analytics, chat widgets) often add 500ms+ — load them with
async or defer, audit regularly - Fonts cause invisible text flash (FOIT) — use
font-display: swap and preload critical fonts - Measure with Lighthouse in incognito mode — extensions skew results
Mobile First
- Start CSS with mobile styles, add complexity with
min-width media queries — easier to scale up than strip down - Touch targets need 44x44px minimum — fingers are imprecise, small buttons frustrate users
- Test on real devices, not just browser DevTools — throttling simulation misses real-world jank
- Horizontal scroll is a critical bug — test every page at 320px width minimum
viewport meta tag is required:
Accessibility
- Every
![]()
needs alt text — empty alt="" for decorative images, descriptive text for meaningful ones - Color contrast ratio 4.5:1 minimum for body text — use WebAIM contrast checker
- Form inputs must have associated
elements — placeholders alone are not accessible - Keyboard navigation must work — test every interactive element with Tab key
- Screen readers announce heading hierarchy — use H1-H6 in logical order, never skip levels
HTML Structure
- One
per page only — it's the page title, not a styling tool - Use semantic elements:
, , , , — they communicate structure to browsers and assistive tech for actions, for navigation — don't use divs with click handlers- External links should have
rel="noopener" — prevents security vulnerability with target="_blank" - Validate HTML — broken markup causes unpredictable rendering across browsers
CSS Patterns
- Avoid
!important — it breaks cascade and makes debugging painful. Fix specificity instead - Use relative units (
rem, em, %) over fixed px for text — respects user font size preferences - CSS custom properties (variables) reduce repetition — define colors and spacing once, use everywhere
- Flexbox for 1D layouts, Grid for 2D — don't force one to do the other's job
- Test without CSS loading — content should still be readable in plain HTML
Common Mistakes
- Missing favicon causes 404 spam in server logs — always include one, even a simple PNG
- Not setting
breaks screen reader pronunciation - Hardcoded
http:// links break on HTTPS sites — use protocol-relative // or always https:// - Assuming JavaScript is available — core content should work without JS (progressive enhancement)
- Forgetting print styles — add
@media print for pages users might print (receipts, articles)
Before Launch
- Test all forms actually submit — broken contact forms lose leads silently
- Check 404 page exists and is helpful — default server 404 looks unprofessional
- Verify social sharing previews with Open Graph tags — test in Facebook/Twitter debuggers
- Submit sitemap to Google Search Console — speeds up indexing
- Set up uptime monitoring — know when your site goes down before users tell you
版本历史
共 1 个版本
-
v1.0.0
当前
2026-03-28 11:12 安全 安全
安全检测
腾讯云安全 (Sanbu)
安全,无风险
查看报告
🔗 相关推荐
ai-intelligence
ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,349
📥 317,697
developer-tools
steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666
📥 323,791
developer-tools
larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65
📥 179,842