I used this php coding in wordpress to get primary menu.
<?php
wp_nav_menu( array(
'menu' => 'Top menu',
'theme_location' => 'primary',
'depth' => 2,
'menu_class' => 'nav navbar-nav',
));
?>
This is the output in preview.
<div class="nav navbar-nav">
<ul>
<li class="active"><a href="#"> NEWS <span class="sr-only">(current)</span></a></li>
<li><a href="#">FUNNY PICTURES</a></li>
<li><a href="#">FUNNY VIDEOS</a></li>
<li><a href="#">GOVERMENT JOBS</a></li>
<li><a href="#">HEALTH</a></li>
<li><a href="#">BEST SHOPING DEAL</a></li>
</ul>
</div>
This should work like below, not like above. Please explain what the change is need to made in php code.
<div>
<ul class="nav navbar-nav">
<li class="active"><a href="#"> NEWS <span class="sr-only">(current)</span></a></li>
<li><a href="#">test</a></li>
</ul>
</div>
Look at the wordpress documentation which states clearly all the things you need .
i didn't clearly understand your question but from what i have understood you may use container class to add class to the div folder and menu_class add class name to ul element .