3 Replies - 592 Views - Last Post: 03 May 2019 - 04:45 AM

#1 matthewjohn938   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 12-October 18

Need Suggestion for creating a sticky nav bar?

Posted 15 February 2019 - 11:39 PM

What is the best way to create a sticky top navigation bar?

Under a smaller navbar, I have a main navbar and I want the main navbar to be sticky when the page scrolls. I have tried (position: fixed), but when it scrolls, it leaves a space where the bar above it is.

Could you please suggest me the best way to do this?

Thanks
Is This A Good Question/Topic? 1
  • +

Replies To: Need Suggestion for creating a sticky nav bar?

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15338
  • View blog
  • Posts: 61,467
  • Joined: 12-June 08

Re: Need Suggestion for creating a sticky nav bar?

Posted 16 February 2019 - 07:49 PM

Have you looked at 'affix'?
https://getbootstrap...vascript/#affix

Then there's this.
https://www.w3school...vbar_sticky.asp
Was This Post Helpful? 0
  • +
  • -

#3 smith bradley   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 02-May 19

Re: Need Suggestion for creating a sticky nav bar?

Posted 02 May 2019 - 08:46 AM

I recommend using a framework like Bootstrap: https://getbootstrap.com/
If you follow the steps on their website you can't go wrong.
Was This Post Helpful? 0
  • +
  • -

#4 matthewjohn938   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 12-October 18

Re: Need Suggestion for creating a sticky nav bar?

Posted 03 May 2019 - 04:45 AM

View Postsmith bradley, on 02 May 2019 - 08:46 AM, said:

I recommend using a framework like Bootstrap: https://getbootstrap.com/
If you follow the steps on their website you can't go wrong.


Thanks for the suggestion. and modi123_1 suggested the same thing and I tried that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1