# Image streched on mobile

**URL:** <https://forum.ghost.org/t/image-streched-on-mobile/28969>\
**Category:** Themes\
**Created:** [March 10, 2022, 4:24pm UTC](https://forum.ghost.org/t/image-streched-on-mobile/28969 "2022-03-10T16:24:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian.fairfax](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@julian.fairfax](https://forum.ghost.org/u/julian.fairfax)\
**Post date:** [March 10, 2022, 4:24pm UTC](https://forum.ghost.org/t/image-streched-on-mobile/28969/1 "2022-03-10T16:24:19Z")

</div>

_Fill out the following bug report template with as much detail as possible!_

_Are you sure this is a bug?_ _If you just need help, post in the developer help category. If it’s a feature request, head to the ideas category._

* * *

**Issue Summary**

- Explain roughly what’s wrong  
I’ve used the image element to add on image to my post and it’s stretched vertically when I view it on mobile
- What did you expect to happen?  
The image should be resized properly

**Steps to Reproduce**

1. This is the first step…  
Add an image using the image element
2. This is the second step, etc.  
Preview the post on mobile

* * *

## Setup information

I wasn’t the one to set it up. I have administrator access to the platform but can’t seem to find where this information would be written.

**Ghost Version**  
_Share which version of Ghost you’re using._

**Node.js Version**  
_If self-hosting - share which version of Node.js you’re using._

**How did you install Ghost?**  
_Provide some details about your install of Ghost if you are self-hosting._

**Provide details of your host & operating system**  
_Include further details about your hosting and OS._

**Database type**  
_MySQL 5.7 / MySQL 8 / SQLite 3 / Other_

**Browser & OS version**  
_Include if reporting frontend bugs._

**Relevant log / error output**  
`Copy and paste any relevant log output. Use backticks to format this into code.`

---

<div class="post-metadata">

**Author:** ![TheRoyalFig](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theroyalfig/32/27771_2.png) [@TheRoyalFig](https://forum.ghost.org/u/TheRoyalFig)\
**Post date:** [March 14, 2022, 11:51pm UTC](https://forum.ghost.org/t/image-streched-on-mobile/28969/2 "2022-03-14T23:51:57Z")

</div>

Are you able to share a link? What theme are you using?

My guess is that you need to add `height: auto` to your CSS.

---

<div class="post-metadata">

**Author:** ![julian.fairfax](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@julian.fairfax](https://forum.ghost.org/u/julian.fairfax)\
**Post date:** [March 15, 2022, 5:48am UTC](https://forum.ghost.org/t/image-streched-on-mobile/28969/3 "2022-03-15T05:48:15Z")

</div>

That actually worked. Thank you!

---

<div class="post-metadata">

**Author:** ![TheRoyalFig](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/theroyalfig/32/27771_2.png) [@TheRoyalFig](https://forum.ghost.org/u/TheRoyalFig)\
**Post date:** [March 15, 2022, 2:20pm UTC](https://forum.ghost.org/t/image-streched-on-mobile/28969/4 "2022-03-15T14:20:25Z")

</div>

Awesome!

A little bit more background on why that worked in case you were wondering.

Ghost automatically adds height and width attributes to images in posts. This is essential for optimizing your site because it prevents jankiness when loading (where the page moves in the middle of reading it) and allows for smart lazy loading.

Because of these attributes, though, you need to specify that the height should be set to auto based on the image’s width.

Here’s an [article from Smashing Magazine](https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/) that goes over all this in more detail.

Importantly, I’m glad it’s working! 😄

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [June 13, 2022, 2:20pm UTC](https://forum.ghost.org/t/image-streched-on-mobile/28969/5 "2022-06-13T14:20:59Z")

</div>

Closed on June 13, 2022, 2:20pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
