How to Display an Image in Any Width and Height Without Ruining the Image Proportion?
Posted: 29 May 2024, 16:11
I am creating a custom template for my WordPress blog by myself as part of my project. But my progress is stuck with a problem. The problem is the distorted thumbnail images.
I need to display thumbnails of the last ten posts on the home page.
The thumbnail is like the following. The top part must contain an image with a width of 100% and a height of 200 pixels.
When I adjust the size of the image with the above rules, it disturbs the image proportion. How can I display the thumbnail image without ruining the proportion irrespective of its natural size?
I need to display thumbnails of the last ten posts on the home page.
The thumbnail is like the following. The top part must contain an image with a width of 100% and a height of 200 pixels.
When I adjust the size of the image with the above rules, it disturbs the image proportion. How can I display the thumbnail image without ruining the proportion irrespective of its natural size?