# Mobile Publication Image

**URL:** <https://forum.ghost.org/t/mobile-publication-image/49850>\
**Category:** Themes\
**Created:** [August 29, 2024, 2:38am UTC](https://forum.ghost.org/t/mobile-publication-image/49850 "2024-08-29T02:38:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![theMelMills](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/themelmills/32/20783_2.png) [@theMelMills](https://forum.ghost.org/u/theMelMills)\
**Post date:** [August 29, 2024, 2:38am UTC](https://forum.ghost.org/t/mobile-publication-image/49850/1 "2024-08-29T02:38:03Z")

</div>

I’m using the new source theme (hosted) and my publication image is getting cut off on desktops. There was a thread in here about using CSS selectors to change the image for mobile views but there doesn’t appear to be a way to do this without reuploading the theme and hosting an image file somewhere to pull from.

Is there another way better way? Can we request a mobile image option for the publication cover image on this theme?

---

<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:** [August 29, 2024, 8:02am UTC](https://forum.ghost.org/t/mobile-publication-image/49850/2 "2024-08-29T08:02:25Z")

</div>

This can be accomplished with code injection and stashing the image on an unpublished post. It’d be a better user experience to edit the theme, but if you can’t upload a custom theme, this is still possible.

---

<div class="post-metadata">

**Author:** ![theMelMills](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/themelmills/32/20783_2.png) [@theMelMills](https://forum.ghost.org/u/theMelMills)\
**Post date:** [August 29, 2024, 5:01pm UTC](https://forum.ghost.org/t/mobile-publication-image/49850/3 "2024-08-29T17:01:15Z")

</div>

Thank you. And what would the code injection part of this look like? I don’t see a way to do this via CSS in the header, targeting the publication image.

---

<div class="post-metadata">

**Author:** ![theMelMills](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/themelmills/32/20783_2.png) [@theMelMills](https://forum.ghost.org/u/theMelMills)\
**Post date:** [September 4, 2024, 4:59pm UTC](https://forum.ghost.org/t/mobile-publication-image/49850/4 "2024-09-04T16:59:53Z")

</div>

I figured this out (with the help of Ghost support) and some additional research.

You can use the content property to target the image class for the publication cover with a CSS media query in the [code injection](https://ghost.org/tutorials/use-code-injection-in-ghost/).

```auto
<style>
@media only screen and (max-width: 600px) {.gh-header-image {content: url(https://imagefile.jpg);}}
</style>

```

This other solution ([https://css-tricks.com/replace-the-image-in-an-img-with-css](https://css-tricks.com/replace-the-image-in-an-img-with-css)) might work as well. It didn’t for my case, but led me to another idea.
