Site logo

Archived topic

Top Bar Alignment for Mobile

6 replies · Started by René on October 4, 2022

Viewing posts 1–7 of 7

I have a sandbox site setup for testing here: http://sandbox.tableaux.com/

How can I set the Top Bar Alignment to "Center" on mobile, but keep it Right aligned on Desktop?

Hi there,

It looks the top bar alignment is correct.

But you have this CSS which adds padding to the menu items so it's a bit off on mobile:

ol,ul {
 padding-left: 30px;
}

Try change it to:

ol, ul:not(.top-bar ul) {
    padding-left: 30px;
}

That worked, but it pushed my primary navigation menu over.

I got it figured out. I took changed the inner header width and then took off that css code altogether and it seems to be working now.

Glad you got it sorted!

Another solution would be to make it so your custom CSS only applies to lists inside the content:

.site-main ol, .site-main ul {
 padding-left: 30px;
}
This archived topic is closed to new replies.