We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Dec 10, 2020 9:25 AM
I've created a custom module which includes a nav menu. The nav includes a parent item with some child items. When viewed the child items always display and the child items make the parent item width huge!
This is what it looks like:
I've set up the menu item like this:
{% menu id="{{ module.menu_field }}", flyouts="{{ module.flyouts }}" %}
flightouts is a booleen.
Solved! Go to Solution.
Jan 21, 2021 7:45 AM - edited Jan 21, 2021 7:46 AM
A position absolute will resolve this.
Remove the Width and White-space and try this.
.main-nav ul ul {
display: none;
flex-direction: column;
padding-left: 0;
}
.main-nav ul li:hover>ul {
display: block;
position: absolute;
}
Jan 21, 2021 7:59 AM
Thanks Philip! Perfect!
Jan 21, 2021 7:39 AM
Thanks - I've just popped something in which seems to be part way there but if feels a bit rough! I've added white-space:nowrap to the <a> and set a specific width to the parent (hs-item-has-children) but this causes the dropdown to push the centrally aligned tagline to move when the child menu opens.
Jan 21, 2021 7:45 AM - edited Jan 21, 2021 7:46 AM
A position absolute will resolve this.
Remove the Width and White-space and try this.
.main-nav ul ul {
display: none;
flex-direction: column;
padding-left: 0;
}
.main-nav ul li:hover>ul {
display: block;
position: absolute;
}
Jan 21, 2021 7:17 AM
Hi guys
Sorry for the delays - I was pulled over to another project. This is he link to the project
http://www-corvid-co-uk.sandbox.hs-sites.com/
Thanks in advance.
Jan 21, 2021 7:26 AM - edited Jan 21, 2021 7:26 AM
Try CSS Styling like this
.main-nav ul ul {
display: none;
flex-direction: column;
padding-left: 0;
}
.main-nav ul li:hover>ul {
display: block;
}
Jan 21, 2021 7:35 AM
Thanks - this solves my dropdown not being a drop down but when I hover over the parent the whole menu item shifts to fit the width of the a links.
Jan 21, 2021 7:36 AM
Glad that worked. Leave it with me and I'll modify the code a little
Dec 11, 2020 10:37 AM
Thanks @Philip_Marsh! my guess with the menu is probably few tweaks in the CSS
Jon Chim
Design Director
Morey Creative Studios
Dec 11, 2020 9:31 AM
Can you provide a link to the page, please?
I'll take a look and try and help as best I can.
Thanks
Dec 11, 2020 9:23 AM
Hi @saustwick!
Welcome to the Community!
It would help if you could provide a link to an example page (preview link would be perfect!)
@jonchim and @Philip_Marsh are some super stars and probably can help you out once we get that link 😀
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |