How do Image format on responsive website

Viewed 35

Hi My English is quite poor :) sorry for that :) I design a responsive website. What is the difference between the given files? I don't understand how to adjust them to the screen size.

jk_ar_16_9,c_fill,g_auto__c_scale,w_720.jpg
jk_1_s6zmfh_c_scale,w_480.jpg
1 Answers

I suppose that first image is bigger, than the second one. To adjust images to the screen size, use picture tag(learn more here):

<picture>
  <source 
    media="(min-width:720px)" 
    srcset="jk_ar_16_9,c_fill,g_auto__c_scale,w_720.jpg">
  <source 
    media="(max-width:720px)" 
    srcset="jk_1_s6zmfh_c_scale,w_480.jpg">
  <img 
     src="jk_1_s6zmfh_c_scale,w_480.jpg"
     style="width:auto;">
</picture>
Related