menu - CSS counter on hidden submenu -
i'm trying make dropdown menu using nested <ul> , every <li> displaying number generated css counters. sub-menus hidden display:none when not hovered. my problem counters not incremented when element has display set none . do know css property prevent this? if replace display: none visibility: hidden , it's working i'm not sure if it's nice use menu, there traps? you can mimick display: none (hidden) behavior setting font-size 0px , make element counted counter property. .hidden{ font-size: 0px; } demo or, bit more complex version of above (mentioned hashem qolami in comments) .hidden{ font: 0/0 a; visibility: hidden; } demo 2 note: visibility: hidden work leave space equivalent height of 1 line in output. demo using visibility property