Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do you add an background image to a confluence page

I have been trying to add an image as a background to a Confluence page using HTML but am struggling to get it to work.

I can change the colour of the area behind the Confluence page but not the Confluence page itself.

Can anyone advise?

1 answer

3 votes

Hi Sarah, 

You can achieve this by creating a user macro. However, you'll need admin access to do this.

Here's some sample code that should help:

## @param image:title=Background Image URL|type=string|required=true|desc=A link to the image to display in the background.
<div style="background-image: url($paramimage)">$body</div>

When creating the macro, you'll need to set the 'Macro body processing' mode to 'Rendered':

Screen Shot 2018-10-04 at 3.58.26 pm.pngThis macro will accept any content in it and display with a background image of your choice behind it.

You can find some additional documentation for writing a user macro here:

https://confluence.atlassian.com/doc/user-macro-template-syntax-223906130.html

Let me know if you've got any further questions!

This is great and extremely helpful. I've been looking for this solution for a long time and finally, this works. The only adjustment I would like to make is to not have the BG image repeat when the page is zoomed out. Is this possible?  

Like Sarah likes this
Sarah Atlassian Team Aug 29, 2019

Hi Lavesh, 

Yes, this should be relatively straightforward to do. 

Simply add an additional CSS property to the macro definition:

## @param image:title=Background Image URL|type=string|required=true|desc=A link to the image to display in the background.
<div style="background-image: url($paramimage);background-size: cover;">$body</div>

You can alternatively use a `background-repeat: no-repeat;` property.

Hope this works for you!

Like Lavesh Budhrani likes this

This works perfectly! Thanks Sarah

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

494 views 24 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you