How to make links with sub-links [closed]

-1

Hello.

How to link and when it is clicked, show more links below?

For example: a link to statistics of issues solved in a site and clicking on this link, display links: discipline, subject, banking. That is, choose the type of statistics.

Obs, searching the internet, I saw drop down, but the links are in visible lists and that's not the idea. I want lists that are only shown when clicking the link.

    
asked by anonymous 01.09.2016 / 22:12

2 answers

2

Use the HTML5 details tag, see an example link

Example obtained from the W3Schools website:

<details>
  <summary>Copyright 1999-2014.</summary>
  <p> - by Refsnes Data. All Rights Reserved.</p>
  <p>All content and graphics on this web site are the property of the company Refsnes Data.</p>
</details>
    
01.09.2016 / 22:14
1

You can do this by using the% css property of css.

Example

ul{
  list-style:none;
}

ul a{
  text-decoration:none;
}

li{
  cursor:pointer;
  float:left;
  position:relative;
  width:150px;
  height:20px;
  border:solid 1px #CCC;
}

ul ul{
  display:none;
  position:absolute;
  top:100%;
}

ul li:active ul{
  display:block;
}
<ul>
  <li>
      <a href="javascript:void(0)">MENU</a>
      <ul>
        <li>
            <a href="javascript:void(0)">SUB MENU</a>
        </li>
      </ul>
  </li>
</ul>
    
01.09.2016 / 22:35