ENع
الدرس 14 · How browsers use HTML

Responsive images

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

A picture that looks sharp on a big screen can waste data on a small one. With srcset and sizes, one img element offers the same picture at several widths and says how wide it will be drawn. Follow the browser on a phone and on a laptop as it works out the slot, multiplies by the screen's pixel density and downloads only the one file it needs. Then add the habits that make images behave: width and height, src and alt, and <picture> for a different crop.

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

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