With the example below we calculate the aspect ratio of an image by setting Width / Height manually, so the aspect ratio value is generated to be put in padding-bottom:
What I would like is something similar: I want to get the widht / height value of an image, calculate the value of the ratio, and put it in its container, all automatically. There will be several images with different dimensions.
<div class="image-container">
<img src="minhaimagen.jpg" width="300" height="200">
</div>
The generated value would be in padding-bottom
in div image-container
Example: link
For some reason you can not put the example here in the Stack.