简体   繁体   中英

How can I make my list to sync with the section (at the same page)

How can I make my <li> to sync with my <section> . I want to click to my navigation bar button/text and directly drive me to the currently section by scrolling down. (at the same page). How can I do that or can I do the same thing in another way?. Btw I am new.

You can use an anchor link for this. The link to an anchor is noted in the href-attribute by placing a # after the file where the anchor is located and then writing down the name of the anchor. A link to an anchor could look like this:

<a href="#anchor">Click here</a>

The anchors for this could then look something like this:

<a name="anchor">Your text section</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM