One of the Projects I am working on, I have a requirement to split 9 top sharepoint navigation links into two rows. I have a master page in action. I would need to display 5 of the navigation links in the first row and then 4 in the second row. Is this possible, can someone help me with the CSs , JS/JQ code? Thanks in advance.

1 Answer 1


You could do it with some javascript - add the <br/> tag after the 5th menu item. Something like this should work:

<script type="text/javascript">
    $("[id ^=zz][id $=_RootAspMenu] li li").children(":eq(4)").parent().after("<br/>")
  • Thanks Damjan, could you explain what zz and _RootAspMenu indicate in terms of id?
    – mdevm
    Jun 7, 2018 at 20:09
  • The id of the ul tag that holds the menu is not fixed, but it always starts with zz and ends with _RootAspMenu (it is usually zz1_RootAspMenu or zz12_RootAspMenu), so with this selector we solve that problem (we find the tag whose id starts with zz and ends with _RootAspMenu). Jun 7, 2018 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.