Archived topic
on mobile menu submenu, current background color
11 replies · Started by Jusung on February 5, 2023
On mobile device, you can see the submenu of Service.
On submenu on mobile device, I want to give current selected background color.
So, when the menu is selected, there should be background color, which is #566270
which code I can use for this?
Hi there,
Just to confirm, do you want the color on desktop and mobile to be different?
Let me know :)
I am confused.
On my mobile, the background current color works, but when I see the mobile size on pc, it doens't work.
Also, on submenu, the current color is gone..? Idk the color set is weird.
can you help me with the code for current background color and current text color with red color only for mobile device?
So, I can try to modify to test.
Hi Jusung,
Can you first add actual links to the Menu items? They're currently just set to #.
Let us know once they are added.
Hello. I have added the menu Item now.
What I am trying to do is that
I want to change the backgournd color of submenu only on mobile device.
And I want to give left padding on submenu only on mobile device.
Hi there,
the theme will automatically add the Customizer > Colors > Primary Navigation Menu --> Current color to that menu item, i visited this page on your site /문의/ and it worked.
What am i missing ?
On the link, you can see the image.
on the sub menu, I want to give padding-left and want to change the background color only on mobile.
When I tried, it was applied to PC and also, the padding was applied to the underline. I only want to give padding-left to the letter and it must be applied to only mobile.
on the sub menu, I want to give padding-left and want to change the background color only on mobile.
The left padding is removed by the CSS you've added here:
#primary-menu ul ul > li a {
padding: 20px 0 20px 0;
border-bottom: 1px solid #566270;
}
Perhaps you need to add some @media:
https://docs.generatepress.com/article/responsive-display/#responsive-breakpoints
Hello.
It works well!!
One thing is that I want to remove the last underline.
I have made underline on the submenu. but the last one should be removed.
Could you help me with this?
Change Leos CSS to:
#primary-menu ul ul > li a {
padding: 20px 0 20px 0;
}
#primary-menu ul ul > li:not(:last-child) a {
border-bottom: 1px solid #566270;
}
Thank you! it works!
Glad to hear that