- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
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
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
Комментарии отсутствуют
Информация о видео
31 мая 2026 г. 4:35:30
00:12:54
Другие видео канала

![[EN] Array autocomplete trick for Chrome devtools](https://i.ytimg.com/vi/RyuK6HTk7nM/default.jpg)

![[EN] Beware a new phishing trick](https://i.ytimg.com/vi/KawXpsAduVQ/default.jpg)





![Прохождение The Last Cube :: [1/?] Синий и красный миры](https://i.ytimg.com/vi/r9a2W8VZAo0/default.jpg)





![[RU] Трюк для автокомплита на элементах массива в devtools](https://i.ytimg.com/vi/lp6toAqqN8c/default.jpg)





