Images from local media providers use their natural dimensions by default, including on file preview pages. Static conversion reads dimensions from the image and caches them in memory for the current process. Web uploads store dimensions with the uploaded file. Remote images and images whose dimensions cannot be determined retain the default
height=315. Videos also retain their existing default height.Explicit
height and width arguments take precedence. When only one is given, the browser calculates the other proportionally. Detected dimensions reserve space before images load, reducing page movement.When the viewport is narrow enough, mobile CSS takes over and forces block images to fill 100% of the page width instead, removing the scrollbar.
Inline images on the other hand never get a horizontal scrollbar, they are just always capped at viewport width.
When the
height argument is given, it changes that default height. Width is still just calculated proportionally to this new custom height.Here's a very long test image:
Very long test image
. And some tall inline maths: . Source.