# Control post image size via code injection

**URL:** <https://forum.ghost.org/t/control-post-image-size-via-code-injection/38661>\
**Category:** Using Ghost\
**Created:** [May 24, 2023, 5:11pm UTC](https://forum.ghost.org/t/control-post-image-size-via-code-injection/38661 "2023-05-24T17:11:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniele\_Avitabile](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daniele_avitabile/32/4995_2.png) [@Daniele\_Avitabile](https://forum.ghost.org/u/Daniele_Avitabile)\
**Post date:** [May 24, 2023, 5:11pm UTC](https://forum.ghost.org/t/control-post-image-size-via-code-injection/38661/1 "2023-05-24T17:11:25Z")

</div>

Dear All,

I am using the Edition theme and can only use code injection to modify the theme. Featured images in a post look enormous for me. Is there a way to set up an upper limit for the featured image to, say, the text width of the post, for the featured image within a post?

I have tried using code injection and modified some of the code given here [How to use responsive images in Ghost themes](https://ghost.org/docs/themes/assets/) but I have been unsuccessful so far.

Thanks!

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [May 24, 2023, 5:31pm UTC](https://forum.ghost.org/t/control-post-image-size-via-code-injection/38661/2 "2023-05-24T17:31:43Z")

</div>

Edition specifically has multiple different post templates that show the image at different widths. If you open the right menu in the post editor, you should see a couple different options for templates. Try choosing the narrow one and see if that meets your wants?

Otherwise, you could try setting something like

```auto
.single-media {
max-width: 720px;
margin-left: auto;
margin-right: auto;
}

```

---

<div class="post-metadata">

**Author:** ![Daniele\_Avitabile](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/daniele_avitabile/32/4995_2.png) [@Daniele\_Avitabile](https://forum.ghost.org/u/Daniele_Avitabile)\
**Post date:** [May 24, 2023, 5:50pm UTC](https://forum.ghost.org/t/control-post-image-size-via-code-injection/38661/3 "2023-05-24T17:50:14Z")

</div>

> [@Cathy\_Sarisky](#):
>
> ```auto
> .single-media {
> max-width: 720px;
> margin-left: auto;
> margin-right: auto;
> }
> 
> ```

Thanks, your help here and elsewhere is much appreciated!
