ENع
الدرس 12 · Layout

Container queries

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A media query asks how wide the browser window is, so a card gets the same answer whether it sits in a narrow sidebar or a wide main column. A container query asks the card's own container instead. Follow one card used in a 250px sidebar and a 700px main column of a 1000px page: mark each slot with container-type: inline-size, let each card ask @container (min-width: 400px), and watch only the card with room go side by side. Then widen the sidebar to 450px without touching the window, and see its card switch too.

10 دقيقة7 خطوات5 أسئلةIntermediate
شكل 12 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.