Every hero needs a cape. With everypage it's easy to add a background to your hero (and other) sections and we're going to show you how.

Here's a video going over what we talk about in this short article:

https://youtu.be/C4fVT5xV_Pw

We're going to be starting with the blank "Pre-Launch" template. This tutorial works for all templates and in fact all sections so don't worry if you have another one. It should look something like this:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f1a7c94e-4195-42ff-b075-4c8835ba5658/Screen_Shot_2020-08-05_at_10.28.27.png

By default, all pages have the background color set from the theme. We won't be looking at this today but if you want to hear more about changing the theme, just let us know 🙂.

To add a background, you have to add a background key in the json of the section you want to change. First, we will set a single color as the background:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a719e7f5-9af3-4f0d-8a89-d100ad81aa16/Screen_Shot_2020-08-05_at_10.30.57.png

That's all it takes! Here's the json for it:

"background": {
  "color": "#e5e5f5"
}

You can use a hex code, rgb or rgba. The rgba equivalent (which would allow transparency) would be:

"background": {
  "color": "rgba(229, 229, 245, 1.0)"
}

Backgrounds can also have images. To do that, first you should upload an image using the media tab:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5b09dce3-2e69-43b6-9a69-3cbc2b9f6a07/Screen_Shot_2020-08-05_at_10.34.06.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e988e328-7e02-4ed8-b5c1-cac8874c3537/Screen_Shot_2020-08-05_at_10.35.08.png

Then, copy the name of the image you uploaded as shown in the above screenshot. You should then paste this into the json like this:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/336bc4cc-966f-40e8-b00c-3eed95b04966/Screen_Shot_2020-08-05_at_10.36.30.png

The json for that is:

"background": {
  "imageUrl": "<what you copied from above>"
}

As the field name implies, you could also use an image url you have directly from the internet. This will work but is not advised as your page will load slower and be less performant because we will optimise your images for you (especially on mobile!).