Skip to main content
Known Participant
July 30, 2017
Answered

(Mis) Using srcset and sizes attributes...

  • July 30, 2017
  • 1 reply
  • 643 views

Using srcset and sizes to deliver scaled image below 420px breakpoint.

It looks simple enough, yet I’m missing something. I have used the srcset and sizes attributes on the first two images in a carousel slider, leaving those that follow as they were for comparison.

Test site at:

http://0182d1d.netsolhost.com/SITE-TESTING/indexTESTcarousel.html

-Thanks in Advance-

    This topic has been closed for replies.
    Correct answer osgood_

    I'm getting a message in the browser:

    fineArt-sm.jpg cannot be displayed, because it contains errors

    I would check that image and I would correct the path to the images in the srcset attribute:

    srcset="images/banner/fineArt-sm.jpg 420w, images/banner/fineArt-lg.jpg 1000w"

    1 reply

    Legend
    July 30, 2017

    Have you got the link to your srcset images correct? If they are located where the default image is (in the banner folder) the browser is returning an error?

    Contains Errors

    http://0182d1d.netsolhost.com/SITE-TESTING/images/banner/fineArt-sm.jpg

    Default image displays:

    http://0182d1d.netsolhost.com/SITE-TESTING/images/banner/fineArt-lg.jpg

    Known Participant
    July 30, 2017

    Osgood,

    I think the image paths are correct, and I did not get a browser error. It did not show the first two images; only the alt content and the caption.

    Slide 3-5 came in just fine.

    I’ve uploaded an annotated screenshot of file menu.

    http://0182d1d.netsolhost.com/SITE-TESTING/Files-screenShot.jpg

    (Apologies if this link is inop... I see it on the server, but onclick "within this reply" wiggy at my end. URL is accurate.

    Hope that helps to clarify.

    osgood_Correct answer
    Legend
    July 30, 2017

    I'm getting a message in the browser:

    fineArt-sm.jpg cannot be displayed, because it contains errors

    I would check that image and I would correct the path to the images in the srcset attribute:

    srcset="images/banner/fineArt-sm.jpg 420w, images/banner/fineArt-lg.jpg 1000w"