Skip to main content
designm19985728
Participating Frequently
January 24, 2019
Answered

nav bar to page section

  • January 24, 2019
  • 3 replies
  • 487 views

I'm not sure if i am describing this correctly.

I want the nav bar to;

1. stay on the page as you scroll down (which i think i can find out how to)

2. have it so when clicked, the page scrolls down to a different section on the current page.

Dreamweaver / bootstrap4

This topic has been closed for replies.
Correct answer Ben M

1. https://getbootstrap.com/docs/4.1/utilities/position/#sticky-top    Follow those instructions about fixed top items to keep the nav up top. Here's an example of it together - https://getbootstrap.com/docs/4.0/examples/navbar-top-fixed/

2. This is just a simple anchor link. Nothing special for bootstrap - HTML a name Attribute 

3 replies

Nancy OShea
Community Expert
Community Expert
January 24, 2019

Named Anchors are deprecated.  There's no telling how long browsers will keep supporting them.   I prefer to use unique IDs instead.

<a href="#section1">Link on same page - section 1</a>

<a href="#section2">Link on same page - section 2</a>

<section id="section1">

This is section 1

</section>

<section id="section2">

This is section 2

</section>

Nancy O'Shea— Product User & Community Expert
Legend
January 24, 2019

Bootstrap has an opton called scrollspy:

Tryit Editor v3.6

Ben MCommunity ExpertCorrect answer
Community Expert
January 24, 2019

1. https://getbootstrap.com/docs/4.1/utilities/position/#sticky-top    Follow those instructions about fixed top items to keep the nav up top. Here's an example of it together - https://getbootstrap.com/docs/4.0/examples/navbar-top-fixed/

2. This is just a simple anchor link. Nothing special for bootstrap - HTML a name Attribute