CSS Menu designer Root Item Link when...

User 52434 Photo


Ambassador
8 posts

I would like to use subitems on a root item with only the subitems having a link associated with them. I don't see a way to have a root item without having a link associated with it.
User 463058 Photo


Ambassador
1,075 posts
Online Now

You need to edit the menu code manually. Here's a short sample menu I just made:

<ul class="menu-menu">
<li class="first"><a href="index.html">Home</a></li>
<li><a href="">Stuff</a>
<ul>
<li class="first"><a href="this.html">This</a></li>
<li><a href="that.html">That</a></li>
</ul>
</li>
<li><a href="about.html">About</a></li>
</ul>


<li><a href="">Stuff</a> is a root item. I don't want it to be a link, so I just change it to this <li>Stuff. Now it's not a link.
User 463058 Photo


Ambassador
1,075 posts
Online Now

Scratch that. The way the menu styling is being applied, it looks like you need the anchor tag, so use this code instead:

<li><a>Stuff</a>

Basically, just drop the href attribute.
User 52434 Photo


Ambassador
8 posts

Thank you! I had tried your first suggestion before I had posted. I tried your second and it works great.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.