Can a button with a dropdown menu be created using just HTML and CSS?
<a id="TakeAction">Take Action</a>
<ul id="actions">
<li>action 1</li>
<li>action 2</li>
...
</ul>
I want the ul#actions menu to appear when the link is clicked (hover is fine too, but click is preferred) so that I can choose my action. I attempted something similar, but the menu disappears when the cursor moves out of the button.
ul#actions
{
display:none;
}
#TakeAction:hover + ul#actions
{
display: block;
}
Is it necessary to use javascript/jquery to achieve this functionality?