Questions tagged [picture-element]

The picture element refers to the HTML5 picture element.

The picture element refers to the HTML5 picture element.

Useful links:

19 questions
7
votes
1 answer

How to view webp format on ie11

Is there anyway to view webp image format on IE11 or can convert it to another format with javascript code on this browser? I tried "picture" element but seems like it cann't work like Chrome62
Hâm Zon
  • 105
  • 1
  • 2
  • 8
4
votes
1 answer

In Chrome the currentSrc of an img element is sometimes empty. How can I prevent this?

UPDATE: I just found some more info. It seems that in Chrome, the currentSrc of the image will often be empty, whereas in Firefox, the URL is always correct. Is the JS trying to access currentSrc before it's available? Is there a way to prevent…
4
votes
2 answers

Is there an 'alt' attribute for the tag? — Use case: picture element without

I am using tags. My target group uses modern browsers, so as soon as Firefox supports WebP there is no need to use the tag. Now:
dash
  • 1,249
  • 3
  • 17
  • 25
4
votes
1 answer

Does setting `width` and `height` attributes in or its do anything?

I want to start using WebP on my site. I'm converting code that looks like this: Example To code that looks like this:
Flimm
  • 136,138
  • 45
  • 251
  • 267
2
votes
1 answer

Safari 14 on Big Sur doesn't load webp and doesn't fallback to other provided sources

I have a picture element that was working on Safari 14 on Catalina. It uses two sources in a picture element. The first one is webp and the 2nd one is jpg. Safari, as it doesn't support webp, used to fallback to the jpg. In the new Big Sur OS it…
yhattav
  • 63
  • 6
2
votes
1 answer

How to define the Microdata markup for an image when it's actually a picture tag?

Within the http://schema.org/Product scope, I want to define the markup for an image. Usually it looks as follows: image-description However, modern responsive pages use the tag.…
Carsten
  • 180
  • 1
  • 9
2
votes
2 answers

HTML5 srcset, sizes & Art Direction

As far as I can tell, the srcset and sizes attributes focus more on applying a suitably scaled image for the device’s size and resolution. There appears to be no facility to use these attributes to select an alternative image based on the screen…
Manngo
  • 14,066
  • 10
  • 88
  • 110
1
vote
1 answer

Responsive picture element downloading correct size image from srcset

Based on the below picture tag, how does the browser determine which of the three files in the srcset attribute to download? My understanding is that the browser will determine which of the three (300px, 600px or 800px) based on the width of the…
Fongers
  • 155
  • 1
  • 1
  • 9
1
vote
2 answers

Why doesn't src inside element load?

Me When I use the picture element, the browser(chrome) doesn't load the image with the other resources. However, when I replace…
Moaaz Bhnas
  • 1,010
  • 7
  • 18
  • 36
1
vote
2 answers

How to make picture element accessible for each breakpoint?

Let's say you have a picture element similar to this:
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
1
vote
2 answers

Picture element: do I need to set the full path in every scrset attribute?

Responsive images, the use-cases and the new HTML5 picture element are explained quite well in this article. Update: To be more specific, I mean with responsive images, resized images for different devices. Less image weight, so faster loading…
Janghou
  • 1,613
  • 1
  • 21
  • 30
1
vote
1 answer

What are the pros and cons of the picture element?

What are the pros and cons of the HTML5 picture element? In particular, whether the browser will download all images? Or the browser downloads only the image matching media query?
js addict
  • 66
  • 4
0
votes
0 answers

Dynamic CSS-Grid size with

I want to build a simple image-lightbox where an image is displayed together with its caption. The image and the caption should be displayed in a single column and the image should scale so that it and the caption fit within the viewport of the…
Skye Ewers
  • 358
  • 1
  • 4
  • 16
0
votes
0 answers

element srcset not working for chrome and edge

I have a Flutter web app and I'm using the element to show a splash screen on the web. I want to display splash screen with different pixel density depending on device. My code:
OutdatedGuy
  • 160
  • 1
  • 10
0
votes
1 answer

Failed to load resource: the server responded with a status of 404 () but visiting url directly shows image

I have a weird problem where the browser says the server returns a 404 on an image. However visiting the URL directly shows the image. The image is within the element, which loads in a slightly different order. Could that be the cause,…
Eoin
  • 1,413
  • 2
  • 17
  • 32
1
2