# Featured image as background

**URL:** <https://community.hubspot.com/t/featured-image-as-background/9114>\
**Category:** CMS Development\
**Created:** [June 11, 2018, 9:47am UTC](https://community.hubspot.com/t/featured-image-as-background/9114 "2018-06-11T09:47:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danidevera](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danidevera/32/75439_2.png) [@danidevera](https://community.hubspot.com/u/danidevera)\
**Post date:** [June 11, 2018, 9:47am UTC](https://community.hubspot.com/t/featured-image-as-background/9114/1 "2018-06-11T09:47:39Z")

</div>

Hello

We want our featured image appear as a background in the post.  
In the list of entries, as there would not be this featured image, we want to put an image by default.

Can you help us?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [June 11, 2018, 1:24pm UTC](https://community.hubspot.com/t/featured-image-as-background/9114/2 "2018-06-11T13:24:19Z")

</div>

I’m assuming you have access to the template code. You can do the following (You will have to change classes and elements since we can’t see your template code to give you a more accurate response)

**Add css to your stylesheet**

`#main_wrapper{background:url('placeholder/background/img.jpg') no-repeat;background-size:cover!important;background-position:center center;}`

Then in your hubl template file:

```auto
<div id="main_wrapper" style="background:url({{ content.featured_image }}) no-repeat;">

 ...the rest of your content

</div>

```

* * *

[tim@belch.io](mailto:tim@belch.io)

---

<div class="post-metadata">

**Author:** ![danidevera](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/danidevera/32/75439_2.png) [@danidevera](https://community.hubspot.com/u/danidevera)\
**Post date:** [June 11, 2018, 1:54pm UTC](https://community.hubspot.com/t/featured-image-as-background/9114/3 "2018-06-11T13:54:40Z")

</div>

Thanks!

It works!!
