---
title: "How do you resize an image while maintaining the aspect ratio?"  
description: "How do you resize an image while maintaining the aspect ratio?"  
author: "Anonymous User"  
published: 2013-06-15  
updated: 2013-06-15  
canonical: https://www.mindstick.com/forum/1129/how-do-you-resize-an-image-while-maintaining-the-aspect-ratio  
category: "html5"  
tags: ["html5"]  
reading_time: 1 minute  

---

# How do you resize an image while maintaining the aspect ratio?

Hi,\
How do you resize an [image while maintaining](https://www.mindstick.com/forum/159383/how-to-auto-resize-an-image-while-maintaining-aspect-ratio) the [aspect](https://yourviews.mindstick.com/view/81162/finding-deglobalization-aspect-in-corona-pandemic) ratio?\
Thanks in advance.

## Replies

### Reply by AVADHESH PATEL

Hi Hugh, \
Set either the width or height to auto and explicitly set the opposite dimension with a fixed length. If width is auto, height has an explicit length , or if height is auto, with has an explicit length.


---

Original Source: https://www.mindstick.com/forum/1129/how-do-you-resize-an-image-while-maintaining-the-aspect-ratio

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
