We would like to know how to create Horizontal Menu with a Dynamic Number of Elements Fit As 100% Evenly.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!-- www. j a v a 2 s .c om-->
text-align: center;
margin: 0 auto;
width: 100%;
}
#menu {
width: 100%;
background: #999;
display: table;
}
#menu ul li {
display: table-cell;
border: 1px solid red;
}
#menu ul {
display: table-row;
}
#menu a {
display: block;
}
</style>
</head>
<body>
<div id="menu">
<ul>
<li><a href="#">Cancel</a></li>
<li><a href="#">Redeem</a></li>
<li><a href="#">Menu 3</a></li>
<li><a href="#">Menu 4 (BIG TITLE!)</a></li>
<li><a href="#">Menu 5</a></li>
</ul>
</div>
</body>
</html>
The code above is rendered as follows: