Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Using anchor points to make simple index effect

Shulou Source: shulou.com Published: 2022-06-01 07:00:11 10月03日 Update

[function description]

When you click the button, the page jumps to the corresponding area

[HTML code description]

[1] [subject framework]

/ * the outermost layer is covered with div To hide the scroll bar * / / * to cover the outside of the detail box with a layer of div, it is to limit the height of the display area * / / * details box * / / * control frame * / / * set the href to # a Click on the tab page to jump to the anchor named a * / A B C D E

[2] [details list]

/ / An information, set id to a, which means that the anchor point is named a / / title A / / content A.1 A.2 A.3 A.4 A.5 B B.1 B.2 B.3 B.4 B.5

[description of CSS key codes]

/ / set the width to be narrower than the child width 20px, and set overflow:hidden to hide the scroll bar and scroll. ListWrapOut {width: 480px; overflow:hidden;} / so that the height is 280px and the background color is # ccc.listWrap {overflow:auto; height: 280px; background-color: # ccc; width: 500px } / / set the calculated height value so that when each anchor point in the detail box will be linked, it can reach the top of the information box. List {height: 1080px;}

[effect display]

Tags: Information height effect code width meaning page body content function area name display area button label title frame background emphasis link Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi Huawei OPPO Reno Microsoft