I have searched high and low but cannot find a satisfactory answer. I have a menu system defined by nested divs within a single div. To maintain the nested divs in a horizontal pattern I have used float: left but I want the overall menu centred on the page; not left aligned as they are at present. I have used the text-align: center within the parent div and have used the margin: 0 auto as well but to no avail. The code follows:
Code:
#nav
{
text-align: center;
height: 1.5em;
}
.nav_element
{
float: left;
padding-right: 30px;
}
<div id="nav">
<div class="nav_element"><a href="index.html">Home</a></div>
<div class="nav_element"><a href="holding.html">Music</a></div>
<div class="nav_element"><a href="holding.html">Websites</a></div>
<div class="nav_element"><a href="holding.html">Favourites</a></div>
...and so on...
</div>