Link to home
Start Free TrialLog in
Avatar of Howard Bash
Howard BashFlag for United States of America

asked on

Handling empty sub-menus with CSS

I had this question after viewing The Menu is good, but needs a couple of Tweaks.

The DIV structure is generated via reading a JSON file and programmatically building the DIVs with whatever nesting the JSON file specifies.  On occasion,  the JSON file can only have a top level link and the sub menu is empty.  The generated structure works but displays an empty node.

Is there any way to hide empty sub-menus?  

I will attach a picture demonstrating the issue and the section of the DIV structure that produces it.

User generated image
Here is the associated html fragment which produces it

      <div class="item">
        <a href="http://www.w3schools.com/js/default.asp">99-JavaScript Tutorial</a>
        <div class="sub-menu">
          <div class="col_1 sub-menu-item">
          </div><!-- Close Col Div  -->
        </div>
      </div>   
      

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Howard Bash

ASKER

Agreed.