Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

img srcset

<img 
    src="http://placehold.jp/3840x3840.png"

    srcset="http://placehold.jp/3840x3840.png 3840w,
            http://placehold.jp/2048x2048.png 2048w,
            http://placehold.jp/1920x1920.png 1920w,
            http://placehold.jp/1200x1200.png 1200w,
            http://placehold.jp/1080x1080.png 1080w,
            http://placehold.jp/828x828.png 828w,
            http://placehold.jp/750x750.png 750w,
            http://placehold.jp/640x640.png 640w"

     sizes="(max-width: 480px) 100vw, 
            (max-width: 1024px) 50vw, 
            33vw"
/>
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #img #srcset
ADD COMMENT
Topic
Name
6+2 =