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,

Bruce

1 answer

1 accepted

Accepted Answer
2 votes

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.

Bruce

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
Posted Oct 11, 2018 in Confluence

What are your project planning tips?

Hello Community,  Jessica here from the Confluence product marketing team! Today I wanted to get your takes on project planning –– what works, what doesn’t, how do you know if you’re doing it r...

232 views 0 4
Join discussion

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