Creating a dropdown button with anchor:target selector - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button style

Description

Creating a dropdown button with anchor:target selector

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

ul#actions<!--   ww  w.  j  av a2 s .c o m-->
{
   display:none;
}
#actions:target
{
   display: block;
}


      </style> 
 </head> 
 <body> 
  <div class="actions"> 
   <a href="#actions" id="TakeAction">Take Action</a> 
   <ul id="actions"> 
    <li>action 1</li> 
    <li>action 2</li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials