Use the anchor to create a simple index [CSSdemo] and an index result cssdemo

Source: Internet
Author: User

Use the anchor to create a simple index [CSSdemo] and an index result cssdemo

[Function description]

When you click the button, the page will jump to the corresponding area

 

[HTML code description]

[1] [subject framework]

<Div class = "box" id = "box">/* append a div with the outermost side, it is to hide the scroll bar */<div class = "listWrapOut">/* Add a div outside the details box, is to limit the height of the display area */<div class = "listWrap">/* Details box */<ul class = "list"> </ul> </div> </div>/* Control Box */<nav class = "conList">/* Set href to #, click this tab to jump to the anchor named a */<a href = "# a" class = "con"> A </a> <a href =" # B "class =" con "> B </a> <a href =" # c "class =" con "> C </a> <a href =" # d "class =" con "> D </a> <a href =" # e "class =" con "> E </a> </nav> </div>

 

[2] [list details]

// A information, Set id to, it means to name the anchor as a <li class = "in" id = "a"> // Title 

 

[CSS key code description]

// Set the width to 20 PX lower than the Sub-Level Width, and set overflow: Den den to hide the scroll bar and scroll. listWrapOut {width: 480px; overflow: hidden;} // The height is 280px and the background color is # ccc. listWrap {overflow: auto; height: 280px; background-color: # ccc; width: 500px;} // set the calculated height, so that each anchor point in the details box can be connected to the top of the information box. list {height: 1080px ;}

 

[Effect display]

 

[View Source Code]

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.