- This topic has 9 replies, 3 voices, and was last updated 7 years, 3 months ago by Tom.
-
AuthorPosts
-
January 8, 2017 at 4:22 am #261828kyle
I would like to have 4 columns in my menu dropdown something like in this example
I know a little bit about css but this is me out of my depth.
How can I go about making this happen?
Any help will be appreciated and thanks in advance.
Kyle
January 8, 2017 at 7:43 am #261853LeoStaffCustomer SupportHi Kyle,
It’s not very simple with CSS – Plugin might be a better option before Tom releases something in future.
Checkout this post: https://generatepress.com/forums/topic/make-css-megamenu/#post-223987
Hope it helps!
January 8, 2017 at 9:58 am #261889TomLead DeveloperLead DeveloperThanks for the challenge! Looks like this shouldn’t be that difficult to add into the theme.
Basically follow the direction you pointed us to, but add this CSS to your site:
nav .main-nav .mega-menu { position: static; } nav .main-nav .mega-menu > ul { position: absolute; width: 100%; } nav .main-nav .mega-menu > ul > li > a { font-weight: bold; } nav .main-nav .mega-menu>ul>li { display: inline-block; width: 25%; vertical-align: top; } nav .main-nav .mega-menu.mega-menu-col-2>ul>li { width: 50%; } nav .main-nav .mega-menu.mega-menu-col-3>ul>li { width: 33.3333%; } nav .main-nav .mega-menu.mega-menu-col-5>ul>li { width: 20%; } nav .main-nav .mega-menu > ul > li > a:hover, nav .main-nav .mega-menu > ul > li > a:focus, nav .main-nav .mega-menu > ul > li[class*="current-"] > a { background-color: transparent !important; } nav .main-nav .mega-menu ul .sub-menu { position: static; display: block !important; opacity: 1 !important; width: 100%; box-shadow: 0 0 0; } nav .main-nav .mega-menu .sub-menu .menu-item-has-children .dropdown-menu-toggle { display: none; }
January 8, 2017 at 10:23 am #261917kyleHello Tom, Just had a quick play with that and It’s working to a point but it’s still displaying vertically for me.
Can you take a quick look and maybe tell me where I’m going wrong?
Thanks in advance π
January 8, 2017 at 10:33 am #261928TomLead DeveloperLead DeveloperHmm, that’s because your menu is floating so the width of it isn’t 100%.
You could set it to below header, remove your logo and add it as a navigation logo.
That way you would have a very similar look, and the navigation would be full width so the mega menu would work.
January 8, 2017 at 10:43 am #261931kyleThat’s got it! Thank you very much Tom!
January 8, 2017 at 12:17 pm #261949kyleOne last thing… Everything is working fine now but i can’t get rid of the white space above the navigation. I have added the code
.site-header {
display: none;
}to my child theme but for some reason this has not worked. If you could take a look I promise I’ll leave you alone for a few days π
Thanks again
January 8, 2017 at 10:54 pm #262041TomLead DeveloperLead DeveloperRemove these lines from your child theme, they’re causing it to break:
@import url('../generatepress/style.css'); <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
January 9, 2017 at 11:47 am #262305kyleThanks again Tom π
January 9, 2017 at 8:47 pm #262447TomLead DeveloperLead DeveloperNo problem π
-
AuthorPosts
- You must be logged in to reply to this topic.