Expanding absolute positioned div containing buttons - HTML CSS CSS Form

HTML CSS examples for CSS Form:input button layout

Description

Expanding absolute positioned div containing buttons

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">

.Menu-Wrapper {<!--from w  w  w .  j a v a2 s . co  m-->
   position: absolute;
   top: 100px;
   left: 100px;
}
.Menu {
   background: yellow;
   position: absolute;
   top: 0;
   left: 0;
   padding: 6px;
}
.Menu-item {
   background: red;
   border: 0;
   margin: 2px;
   padding: 0;
   display: block;
   white-space: nowrap;
   width: -moz-available;
   text-align: left;
}


      </style> 
 </head> 
 <body> 
  <div class="Menu-Wrapper"> 
   <!-- there would be a trigger button here, left out for simplicity --> 
   <div class="Menu"> 
    <!-- in firefox the follwoing buttons do not expand to width text --> 
    <button class="Menu-item">Menu Point 1 ....</button> 
    <button class="Menu-item">Menu Point 1</button> 
    <button class="Menu-item">Menu Point 1..</button> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials