Template builder-background setting. Please advice.

Hello,
I would like to ask you for advice.
I am trying to re-create an email template which was made with Code Editor to a Template Builder Email.
Since I have almost made it with just a few details yet to be done… one of them is placing the background image to it.
I will appreciate if you give me an advice how to find a solution to insert the background to look like just the one from the Code Editor email template ( to be full-size on the page ). Please see the images attached:

Thank you.
Best regards, Nick.

@birimski,

I first would suggest that you consider not using a background image, but instead use a regular image with the text included as part of the image. The reason being that live text doesn’t matter in emails and the more complicated your email css the less accepted it is by all of the email clients.

That being said, if you want to use a background image then my suggestion would be to use HubL.

You are using the template builder, correct? to build the banner with background image capabilities you will want to custom build your banner. Drag a “Custom HTML” module to where you want your banner. Paste this code inside it:

<table style="background: url({% image_src "banner_bg" label="Banner BG Image", src='//cdn2.hubspot.net/hub/53/file-733888614-jpg/assets/hubspot.com/about/management/dharmesh-home.jpg', no_wrapper=True %}) center center no-repeat; background-size: cover; padding: 100px 0;">
 <tbody>
 <tr>
 <td>
 {% widget_block rich_text "banner_content" overrideable=True, label='banner Content' %}
 {% widget_attribute "html" %}
 <h1>Something Powerful</h1>
 {% end_widget_attribute %}
 {% end_widget_block %}
 </td>
 </tr>
 </tbody>
</table>

This is just a table with an editable img_src module applied to the background with inline styling. I made the background position center, it doesn’t repeat, and the size is set to cover.
inside the table’s only td is a rich text module. You set up your content for the banner here.

You will most likely need to make adjustments to the structure or style of this but it should do what you are are needing.

Hello @Jsum ,
Thank you very much for the fast answer.
You are correct, I am constructing the template with the Template Builder.
I am trying to apply a full-background cover just like on the image attached ( the one with the blue background ) instead of the default white background on the page. I have added this code to the Custom HTML module as you adviced, but it shows the background as a banner but I want it to look like a background like on the image attached - Imgur: The magic of the Internet .
Thanks again for the answer.
Kind regards, Nicky.
Update: I have made a Custom Module for the background by watching this tutorial and followin the instrucions as listed there: Fix Your GTM & Scale Revenue | Elite HubSpot Solutions Partner
But somehow this default class of .body-container-wrapper doesn’t associate even when I check on Preview section of the Custom Module to see if the image is showing - it doesn’t .
When I add this Custom Module to my template it doesn’t show anything.

@birimski,

I see now. You want the image to be on the body of your email.

Aside from that tutorial promoting poor development practice, it is also not approporiate for emails. The rules to email development are different, and the default hubspot classes that the tutorial assumes are in use in your template will not be in use in an email template by default.

Instead, you could edit the head of your email template and apply the background image to the body:

<style>
 body {
 background: url(image.jpg) center center no-repeat !important;
 background-size: cover !important;
 }
</style>

the reason the code that the tutorial provided isn’t working is that

.body-container-wrapper

is not a class on any elements in your email template.

Hey @Jsum ,
I really appreciate your help. Thank you.
I have added this code in the <head> editor but the image is not diplaying.
Please check the video - https://youtu.be/JCDmzmASWhw
Regards, Nicky.

@birimski,

can you share a preview link to the email and the url of the image you are trying to use?

@Jsum ,
the system keeps deleting my post with the preview links, so I sent you a PM. Probably it reads it like a spam.
Thanks.

@birimski,

It wouldn’t take on the body tag like I though. I was able to get it to work by applying it to the backgroundtable id:

#backgroundTable {
 background: url(http://cdn2.hubspot.net/hubfs/1620984/Newsletter_January/newsletter-bg-j.jpg) center center no-repeat !important;
 background-size: cover !important;
}

@Jsum ,
Thank you so much for the solution. It worked.
Best regards, Nicky.
Have a nice and successful day!