What I am trying to do is have the mega menus appear on desktop from 1140px onwards,
I can do this by adding this which makes it a width of a Bootstrap container:
.dropdown-menu{ min-width: 1140px }
However, as you can see if teh screen gets smaller, the menu gets cut off.
At the moment, the menus appear to the left of the main nav item.
Is there a way to have the megamenu is view all the time on desktop without making the menu smaller? I’m guessing it could move to the left with the arrow indicate in the middle of the menu?
Yes i’d leave the menu where it is on the first item and just move the caret. You’ll need to reset the stacking context but the following should do that.
I have added that code, but the menus are now in the same place as each other which I guess could work, but it means the caret isn’t under the item is is a dropdown of.
I was trying to have them appear under their respected item on the main menu, but not sure how to deal with the fact that the second and third menu get cut off.
I thought about making the width of the menus smaller, but it would mean reducing them quite a lot.
That’s not really viable and is not the way that megamenus are supposed to work. They are supposed to be full width and just the caret moves. Otherwise you are going to make them too small width wise and too long the other way.
I seem to have seen a lot of menus that appear under different parents in different locations, but guess it’s better practice to have it so they are full width/in the same place.
The only thing I will need to work out is how to have the third caret appear part of the blue left hand side, but thinking I could add a top border to each so the carat looks part of the appropriate menu
Yes I think that’s a good idea and you could add a thick coloured border to the top of the menu to match the caret color. You may need to tweak positions but should be pretty easy.
What I tried to do is have menus on desktop which is the current megamenus show on desktop and hide on mobile, and then have separate menus on mobile that are hidden on desktop and shown on mobile.
I can’t seem to wok out how to do this as I have tried something like this:
but is seems to hide the whole menu/not the correct versions. I think I have the classes wrong.
Is this the way to go or is there a better way to achieve this? I’m thinking it would be better to show/hide a separate menu than trying to restructure the megamenus on mobile?
At the moment the mobile-sub-menu is displaying on desktop/tablet/mobile as I was playing around with it.