Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Adding a CSS dropdown menu to existing off-canvas menu WordPress



Not entirely a WordPress question, but I'm looking for a way to implement a simple CSS only, single-child, vertical dropdown menu to this example:

Note, I'm specifically aiming at example 4:, when wider than 45.0625em (desktop)

Anything smaller and display: none; would be sufficient

Also note I'm <em>not</em> affiliated with this script

Could someone perhaps assist me with this?

Best regards,


Answers (2)


zebra webdesigns answers:

Hello COr

I need clarification in this. the example shows single line of 4 menus aligned horizontally.
Do you want to keep that and hide the mobile menu ??

in that case the css will be

@media all and (max-width:45.0625em){
#top .nav-btn {
display: none;

cor comments:


I've just added a small mock-up (using Excel; sorry about that).
It should explain what I'm after.

In short, the 'blue' drop down menu currently isn't included in the mentioned script, and is what I'd like to see included.

zebra webdesigns comments:

Hello Cor here is the full pastebin version

below is the exact css you need

#nav ul li ul{
position:absolute !important;
display:none ;
#nav ul:before, #nav ul:after{

#nav ul li ul li{display:block !important;}
#nav ul li:hover ul,#nav ul li a:hover ul{
display:block !important;

#nav ul li li a{
#nav ul li li a:hover{
@media all and (max-width:45.0625em){
#nav ul li ul,#nav ul li:hover ul {
display: none !important;


zebra webdesigns comments:

I have attached the image, How it will look once you use the code I provided.