Ensure images maintain aspect ratio on Drupal 9 upgraded site which adds width and height to HTML source of image output
- css properly scale images with width and height
- image ratios kept correct not skewed
Ensure all images retain aspect ratio, not just ones we size here.
Ensure images maintain aspect ratios on Drupal 9 upgraded site which adds width and height to HTML source of image output.
The correct solution here is to ensure anywhere you have an auto width or a percentage width in CSS, you also have an auto height.
Easiest way to do that is to have:
img {
width: auto;
height: auto;
}
so when later you might throw on a width: 100%
or somesuch in your CSS, the height is already auto, which overrides the pixel dimensions in the height and width in HTML.