Jump to content


Photo
- - - - -

How to center Scroll Spy navbar

scroll spy navbar center

Best Answer Danny , 28 October 2013 - 09:36 AM

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.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 achif

achif

    Advanced Member

  • Members
  • 51 posts
  • LocationViña del Mar, Chile
  • Country: Country Flag

Posted 12 February 2013 - 06:42 PM

Hello

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

please help. thanks.



#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 12 February 2013 - 06:54 PM

What ways have you tried with CSS so far?



#3 achif

achif

    Advanced Member

  • Members
  • 51 posts
  • LocationViña del Mar, Chile
  • Country: Country Flag

Posted 12 February 2013 - 07:04 PM

<#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



#4 achif

achif

    Advanced Member

  • Members
  • 51 posts
  • LocationViña del Mar, Chile
  • Country: Country Flag

Posted 12 February 2013 - 07:45 PM

anyone?



#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 12 February 2013 - 11:15 PM

Link to the site?



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 12 February 2013 - 11:22 PM

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.



#7 mtaus

mtaus

    Super Member

  • Members

  • 137 posts
  • Country: Country Flag

Posted 27 October 2013 - 10:27 PM

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



#8 Danny

Danny

    Is Awesome!

  • Moderators
  • 17580 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 28 October 2013 - 09:36 AM   Best Answer

Hi,

 

There is forum topic somewhere which covers this already.

Please Login or Register to see this Hidden Content

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


  • tsalstrand and ingo68 like this





Also tagged with one or more of these keywords: scroll spy, navbar, center