Questions tagged [srcset]

The srcset attributes on the img element can be used, using the x descriptor, to provide multiple images that only vary in their size

390 questions
0
votes
1 answer

srcset and sizes not working in safari?

For some reason the srcset and sizes aren't working correctly when viewing my site in Safari. It works fine for Chrome and Firefox but when viewing in Safari it loads the biggest image available even though the smaller ones which i've defined are…
Shaun
  • 757
  • 1
  • 8
  • 36
0
votes
1 answer

Choosing images in srcset

I'm trying to choose between two images in srcset: if screen is less than 1120px I want to get image_a.jpg; if it is bigger, I want image_b.jpg. I'm trying to figure out how to do this, but reading the documentation I can't get a precise idea. It…
user8925307
0
votes
1 answer

disable srcset for specific page template

I'm trying to disable reponsive images in Wordpress for specific page templates (which are being used for custom RSS feed where srcset is not appropriate). add_filter( 'wp_calculate_image_srcset', '__return_false' ); in the functions.php of th…
0
votes
0 answers

Are there disadvantages to including many options in a responsive 's srcset?

A project I'm currently working on needs responsive, lazy-loaded images with particularly flexible sizing: any given component may be rendered at the full width of the screen or down to 25% of it depending on other contextual elements, and we're…
0
votes
3 answers

Why are these responsive images not filling the wrapper?

I have a responsive image (srcset) that should be displayed at a max-width of 30rem, and fill the viewport otherwise. For that purpose I have the following html:
user5918874
0
votes
0 answers

Enforce largest srcset image

So my client was complaining that their images were blurry as hell despite uploading very crisp, retina images. Upon investigation, the culprit is WordPress' automatic srcset attributes. I dunno if it's intended or not, but they just look…
MitchEff
  • 1,417
  • 14
  • 29
0
votes
2 answers

Can anyone see where I'm going wrong with this srcset?

I'm building a responsive Wordpress website. The blog feed has a list of stories which have a title and an image. The image sizes should be as follows: up to 479px wide - 140x140px (stories are displayed in a list) over 480px wide - 360x190px…
Ali Green
  • 599
  • 1
  • 5
  • 16
0
votes
1 answer

Srcset not working but shows alt tag message

I am building a new website, and want to use the srcset to let the browser deside what image is the best for the current viewport. What happens is that what ever i put in the srcset the browser will just show the alt tag text "test". If i through…
Axel Andersen
  • 330
  • 4
  • 14
0
votes
0 answers

srcset not working properly

I'm trying to get the srcset working so I can have multiple images loaded on different screensizes but it gives me the following error in the console: "Failed parsing 'srcset' attribute value since its 'w' descriptor is invalid." This is how I'm…
Larsmanson
  • 413
  • 1
  • 5
  • 18
0
votes
1 answer

ckeditor 4.4 responsive image upload with old image plugin and custom filemanager to add srcset, sizes attribute

I have ckeditor 4.4, Old Image plugin (Not Image2), and I am using custom filamanager to upload files. How can I add responsive images to ckeditor. I mean, I have to add sizes and srcset attributes automatically to img tag. Image preview also should…
vikram eklare
  • 800
  • 7
  • 25
0
votes
1 answer

Responsive image resolution iPhone vs iPad

I want to use srcset to provide 2x images for iPhone and iPad, but the 2x descriptor applies to both and the images should be different. On both devices the image is full width. But on iPhone 2x of 320w is 640w and on iPad Pro 2x of 1024 is…
gabdara
  • 486
  • 3
  • 10
0
votes
3 answers

Copy data-src attribute to img src when data-src is located in div above using array to apply to multiple img's

The current script I am trying to use (image defer) wants to locate the data-src attribute in the img element. My data-src is not in that element but located in the div it is contained in. I need to change the script so the it finds the data-src in…
Twinstream
  • 11
  • 4
0
votes
0 answers

Img srcset: How to use specific sizes?

I have an image that I want to swap out at specific twitter bootstrap breakpoints. These are 768, 992 & 1200px. I have a different size img for each of these breakpoints. 720px for min 768px wide, 616px for min 992px wide & 750px for min 1200px…
Clinton Green
  • 9,697
  • 21
  • 68
  • 103
0
votes
1 answer

Cannot get srcset to load correct image

I'm using the HTML below & testing using Chrome but no matter the width of the browser (when using the responsive dev tools) the 150x150 image is always loaded. If I was understanding it correctly I thought when the browser width is under 150px it…
Neil Nand
  • 549
  • 6
  • 25
0
votes
1 answer

HTML Feature Detection and Universal React

We have a universal React application sitting behind a CDN. We want to serve up HTML with srcset images from the server, but need to handle the fact that IE will not support this HTML feature, ideally using feature detection. As the site is served…
Alasdair McLeay
  • 2,572
  • 4
  • 27
  • 50