I wonder how to change the layout of a JQuery UI menu from vertical to horizontal.
I have tried this but it only worked for main links on the menu bar but not the ones on the submenu.
I mean the items under 'Delphi' kept on displaying horizontally instead of dropping down vertically as these are sub items of Delphi:
<style>
.ui-menu:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.ui-menu .ui-menu-item {
display: inline-block;
float: left;
margin: 0;
padding: 0;
width: auto;
}
</style>
<nav>
<ul id="ui-menu" class="ui-menu">
<li><a href="#">Link one</a></li>
<li><a href="#">Link two</a></li>
<li><a href="#">Link three</a></li>
<li><a href="#">Link four</a></li>
<li>
<a href="#">Delphi</a>
<ul>
<li><a href="#">Ada</a></li>
<li><a href="#">Saarland</a></li>
<li><a href="#">Salzburg</a></li>
</ul>
</li>
</ul>
</nav>
$(function () {
$("#ui-menu").menu();
});
Edit
This is a screenshot of what I have achieved so far, and what still needs to be done:
Please let me know what I'm doing wrong.
Many thanks.
I've found this CSS NAV Generator which would solve the problem (kind of ..):