Trung BìnhCSS iconCSS

Container queries là gì?

Responsive theo kích thước container thay vì viewport. @container (min-width: 400px) { ... }. Container phải có container-type: inline-size (và tuỳ chọn container-name để query có tên khi dùng nhiều containers lồng nhau).

Ngoài size queries, CSS 2023 còn hỗ trợ container style queries — query giá trị custom property: @container style(--featured: true) { ... }. Browser support: baseline 2023. Lợi thế so với media queries: cùng component có thể hiển thị khác nhau tùy vị trí đặt, không cần biết viewport.

Xem toàn bộ CSS cùng filter theo level & chủ đề con.

Mở danh sách CSS