News for hackers. Stuff that matters.
Re:Firefox 75: Ambitions for April by butz on Tuesday April 07, 2020 @01:09PM (#22805160)
Now it is recommended to use width and height attributes on img elements. It will help to prevent viewport jumping and will support responsive aspect ratio resizing. https://www.youtube.com/watch?v=4-d_SoCHeWE
Re:Firefox 75: Ambitions for April by gshdg on Tuesday April 07, 2020 @03:24PM (#22806570)
That's been recommended since about 1993. That doesn't mean more than 10% of sites have ever actually followed the guideline.
Re:Firefox 75: Ambitions for April by bfred_it on Tuesday April 07, 2020 @09:07PM (#22809160)
WordPress does this by default and that’s the most common platform to date. I’d dare to say that most websites have those attributes, but most SPAs don’t, because that’s too hard.
Re:Firefox 75: Ambitions for April by zeroimpl on Tuesday April 07, 2020 @06:48PM (#22808316)
If you specify both a width and height, it's not going to be very responsive.
Re:Firefox 75: Ambitions for April by bfred_it on Tuesday April 07, 2020 @09:05PM (#22809150)
The attributes are overridden by CSS. You should have:

    max-width: 100%;
    height: auto;
What the other user is talking about is a new feature that FINALLY uses the attributes to preserve the ratio before the image starts loading.

Kinda ridiculous that we had to wait 8 years of “responsive design” before they realized that this was always supposed to happen.