I can create top navigation snippet by going to master page and clicking snippet. But it prints lots of div and extra classes. That's messing my CSS for the html navigation. Is there any way to print it only

  • Home
  • About Us
etc. by eliminating all other extra tags?

1 Answer 1


As far as I know, you can't do it. Just create your own control. But I recently did custom design, and I solve this problem.

Create a little js script, that remove all css classes from rendered html, except "ms-hidden" class. You can insert it in masterpage right after the control.

function clearCss(element) {
  var childs = element.childNodes;
  for (var i = 0; i < childs.length; i++) {
    if (childs[i].className != 'ms-hidden') {
      childs[i].className = '';

Set styles in css like this:

#DeltaTopNavigation {}
#DeltaTopNavigation ul {}
#DeltaTopNavigation ul li {}
#DeltaTopNavigation ul li a {}

For me it's working great.

  • thanks for the solution. Ya Seems like it's not possible without using your own custom way.
    – Ekram
    Commented Nov 24, 2013 at 8:00

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.