Image in a headline

We have a long page with different headlines and at the end of the headlina an image with a link to jump to the top of the page. Now we also have a toc at the top a of the page which now also displays the images. Is there a way to show only the text of the headline without the images?

Thanks for your input,


1 answer

1 accepted

2 votes
Accepted answer

You can hide the images by inserting the following CSS into your space or global stylesheet of Confluence:

ul li a[href^="#"] + a img, ul li a[href^="#"] + a + a img {
  display: none;

Hope this helps

Hi Bruce, sorry there was a typo in my answer. Could you please try it again?

thanks Remo,

I am new to Confluence and maybe I am going wrong somewhere. What I did is go into the Space Admin and then chose "Stylesheet" and added the lines. But this did not have any effect on the toc. Perhaps I have not described the point precise, I now have pages with headlines and in the same line two images. These pages are included into another page which has the toc and shows all headlines from the included pages with the images. What we would like is that in this toc only text is visible and no image. Your help is appreciated.


Hi Remo, thanks a lot for the help but this does not help. I have found out that it has to do with the link defined to the image. As soon as I unlink the image it will not be displayed in the toc anymore. Do you have any more ideas?

Made another small change to the code in my answer. It should now work for image links in the toc. Let me know if this works.

thanks, we are getting nearer. What happens now is that the first of the two images is not displayed.

Sorry, seems like I didn't read your comment properly... I added a CSS selector for the second image link in my answer.

This would be a simpler solution with CSS3, but I'm not sure if it's compatible with your browsers:

ul li a[href^="#"] ~ a img {
  display: none;

Hope this works now for you

Thanks a lot, tha "simpler" solution works great in IE, Firefox and Chrome

Great! Good to know!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

503 views 3 18
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you