Загрузка...

Should you specify width and height on responsive images?

In comment to Kevin's video I said that it has no sence, but than I desided to check it and found out that my point was obsolte.
https://www.youtube.com/watch?v=CwuSpyDwYjM&lc=Ugyf0wVyaw8R_bmMa554AaABAg

The right answer is yes, in modern browsers (from somewhere between 2021 and 2026) you can specify both width and height to prevent layout shift even if using height: auto in css. But you definetely couldn't in 2016.

Timeline:
00:00 Intro
01:14 The problem
03:28 Adding height attribute
05:00 Adding width attribute
05:26 Why height: auto breaks it in an old browser
06:45 Why it works in a modern browser
09:22 Demo with large responsive image
10:26 Debugging assidential values swap
10:59 Fixed attributes
11:50 Showing it doesn't work in Opera 36

Видео Should you specify width and height on responsive images? канала QwDragon
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять