css - Resize unknown number of elements to fill width of parent container -


i need put unknown number of divs (likely limit of 5) parent container , make sure remain equally divided. i'm not sure if can done css alone figured better ask. if know 3 divs used:

<style>   .menu-button {      float: left;     width: 33%;   } </style> <div>    <div class="menu-button">button x</div>    <div class="menu-button">button y</div>    <div class="menu-button">button z</div> </div> 

seems work, if number of .menu-button divs unknown? there better way automatically adjusts horizontally?

unfortunatly think you'll have use tables this. <td>'s resize itslef fit full width.

hth


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -