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

Add horizontal navigation bar to page header using HTML/CSS Edited

We're trying to create a horizontal HTML navigation bar in our Confluence space, following the basic tutorial here: https://www.w3schools.com/howto/howto_css_dropdown_navbar.asp

When we edit our space's stylesheet and insert the HTML into an HTML macro it works perfectly. However, this option is not scalable, as we would have to enter this HTML macro manually into each existing and new page within the space.

The perfect place for this HTML to live seems to be in the space's page header so it was at the top of every page within the space by default. However, when we insert the HTML into the header, combined with the stylesheet changes, it causes major formatting issues and renders the page unusable. The header becomes large enough that it consumes most of the page and renders the rest of the content unreadable/uneditable. As you can see in the attached screenshot, the regular content is pushed very far down.

The same issue does not happen when inserting the HTML into the page footer, but this is not a viable option as users would have to scroll to the bottom each time they would like to navigate.

Does anyone have any suggestions? We would really love for this HTML to live in the page header without messing up the formatting.

Thank you so much!

Example Header Bug.PNG

1 answer

0 votes
Brian L I'm New Here Nov 19, 2020

I wanted the same thing, but had lots of challenges getting this done - but did finally figure it out.  Here's what I did:

1.  Create a page to store my navigation bar.  In this page, add an "excerpt macro".  Inside that, add an "html macro".  Inside that html macro, add all your html/css from W3 Schools.

2.  Edit your space, go to look and feel, then navigate to the header section.  Use the following wiki markup language to call an excerpt-include macro of the page you created the nav bar in.  Mine looks like this:

{excerpt-include:NetworkNavBar|nopanel=true}
\\

Note: the double slash is just a carriage return to add spacing, or the "edit" page links overlapped with my nav bar.

Hope this helps you!

Brian

Suggest an answer

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

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

26 views 0 2
Read article

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