• 0

How to center Scroll Spy navbar


Question

Posted · Report post

Hello

I've tried different ways to center the navbar generated with scrollspy section but nothing works.

please help. thanks.

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted · Report post

Hi,

 

There is forum topic somewhere which covers this already.

#site .spynav ul { text-align: center; float: none; }
#site .spynav li { float: none; display: inline-block; }
#site .spynav .nav > li:first-child > a,
#site .spynav .nav > li:first-child > a:hover {
border-left: 1px solid #BABABA;
    .border-radius(0);
}

Add the code above and that should center your ScrollSpy nav.

3 people like this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

What ways have you tried with CSS so far?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

<#scrollspy #spynav.spynav.spynav-fixed UL.nav.nav-pills li a { text-align:center; margin: 0 auto; float:none; }

 

DIV#spynav.spynav.spynav-fixed UL.nav.nav-pills { text-align:center; margin: 0 auto; float:none; }>

 

and other options

nothing works

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

anyone?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Link to the site?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Okay,  I've inquired among my colleagues and the consensus is that it doesn't look like Scroll Spy can be centered. There's no menu inside, just the series of li tabs. So you'd have to space the tabs rather than center the menu.

 

That certainly explains why your CSS isn't working.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Curious if anyone's figured out how to center the ScrollSpy nav. It's not very aesthetically pleasing without centering. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now