html - Responsive image mapping does not work to scaled images -


i use picturefill.js responsive image feature. when place original image without specifying height , width, image shown in <picture> tag , pull different size of same images according screen size.

but when specify height , width, responsive feature not work. image loaded <img> tag.

here link

the documentation of library explains should manage image size using sizes tag:

<img   sizes="(min-width: 40em) 80vw, 100vw"   srcset="examples/images/medium.jpg 375w,           examples/images/large.jpg 480w,           examples/images/extralarge.jpg 768w"   alt="…"> 

by defining style width , height forcing image keep aspect.

from site:

the sizes syntax used define spaces image occupy in layout. srcset defines list of images , inherent widths. allows browser choose smallest appropriate source size available in part of layout, rather viewport size alone.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -