CSS Menu designer Root Item Link when...
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.
You need to edit the menu code manually. Here's a short sample menu I just made:
<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.
<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 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.
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.
<li><a>Stuff</a>
Basically, just drop the href attribute.
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.