Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #3079

viewport

Skill này làm gì

Skill này kiểm tra trang có thẻ meta viewport cần cho bố cục di động hay không. Nó dành cho lập trình viên xây dựng website đáp ứng.

Khi nào nên dùng

  • ✓Khi một trang hiển thị quá nhỏ trên điện thoại và phải phóng to mới đọc được.
  • ✓Khi một template mới thiếu thẻ meta viewport.
  • ✓Khi rà soát các thành phần dùng chung xuất ra mã head của trang.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/viewport/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/viewport/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Trên điện thoại, website của tôi trông như một trang desktop nhỏ xíu. Tôi cần thẻ nào để sửa điều đó?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra phần head để tìm thẻ viewport và thêm vào nếu thiếu. Nó cũng bảo đảm không có cài đặt nào chặn việc phóng to.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Set the responsive viewport meta tag

Without the viewport meta tag, mobile browsers render pages at desktop width (typically 980px) then shrink them, making text unreadable without zooming.

Quick Reference

  • Add <meta name="viewport" content="width=device-width, initial-scale=1.0">
  • Never use maximum-scale=1 or user-scalable=no (breaks accessibility)
  • Essential for mobile-responsive layouts

Check

Verify that this HTML document includes a proper viewport meta tag for responsive design that controls how the page is displayed on mobile devices.

Fix

Add the viewport meta tag: <meta name="viewport" content="width=device-width, initial-scale=1.0"> in the head section.

Explain

Explain how the viewport meta tag enables responsive design and why it's essential for mobile-first web development.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Set the responsive viewport meta tag. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/html/viewport

Câu hỏi thường gặp

Thẻ viewport làm gì?

Nó bảo trình duyệt di động dùng chiều rộng thiết bị, thay vì dựng trang ở chiều rộng desktop rồi thu nhỏ lại.

Nên tránh những cài đặt nào?

Skill cho biết không nên dùng maximum-scale=1 hay user-scalable=no, vì chúng phá vỡ khả năng tiếp cận.

Có cần cho thiết kế đáp ứng không?

Có. Skill gọi nó là thiết yếu cho bố cục đáp ứng trên di động.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing templates, rendered HTML, or shared components related to Set the responsive viewport meta tag. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#3079
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự