0

I am creating a dropdown menu for my blog and found a really helpful code from CSS-Tricks long dropdown solutions. It makes the menu scroll up and down on hover really great.

I tried changing some HTML and CSS but I can't make it work. Does it require changing the markup and CSS? Is there a way I can implement the code on my menu that doesn't have <ul> and <li> properties? What changes should I make to make the code work? Please give me some instructions on how to do it - that code is really wonderful.

<div class="dropdown">
<button class="dropbtn">Navigation</button>
<div class="dropdown-content">
<a href="List 1">1</a>
<a href="List 2">2</a>
<a href="List 3">3</a>
</div>
</div> 
Keara
  • 589
  • 1
  • 6
  • 17

1 Answers1

0
<div id="wrapper">
    <div class="dropdown">
 <div class="dropdown">
        <button class="dropbtn">Text</button>
          <div class="dropdown-content" style="width: 200px; height: 100px; overflow-y: scroll;"><a href=" ">Lists 1</a>
            <a href=" ">Lists 2</a>
            <a href=" ">Lists 3</a>
            <a href=" ">Lists 4</a>
            <a href=" ">Lists 5</a>
            <a href=" ">Lists 5</a>
            <a href=" ">Lists 7</a>
            <a href=" ">Lists 8</a>
            <a href=" ">Lists 9</a>
            <a href=" ">Lists 10</a>
            <a href=" ">Lists 11</a>
            <a href=" ">Lists 12</a>
            <a href=" ">Lists 13</a>
            <a href=" ">Lists 14</a>
          </div>
      </div>
</div>

I just checked this and this is working as per your requirement. Just adding style="overflow-y: scroll"; in you div container this I'll work