- This topic has 32 replies, 3 voices, and was last updated 4 years, 1 month ago by
Tom.
-
AuthorPosts
-
November 21, 2018 at 10:32 am #733649
Harris
Hello
Is it possible to replicate something like this for the submenus?[img]https://i.imgur.com/xFZIyoR.png[/img]
November 21, 2018 at 3:01 pm #733884Tom
Lead DeveloperLead DeveloperHi there,
You could do something like this:
.main-nav > ul > li > .sub-menu:before { content: ""; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid #fff; position: absolute; top: -10px; left: 20px; }
November 22, 2018 at 12:22 am #734109Harris
Thanks a lot Tom!
You can check live what has been done up to now and how it looks.
I will need some more help though.1. I need to form the arrow on the top of the sub-menu box
2. Middle lines between sub-menu choices are not showing. ( I guess the css you gave me was for that)
3. The arrrow that indicates that a sub-menu exists, breaks the alignment of the vertical dashes of the main menu choices
4. I must ommit the vertical dashes of the sub-menu choices (but keep it on main menu).
5. How can I change the sub-menu text size and weight?
6. Need to add some padding to the sub-menu box and some indent to the text.Thanks
HarrisNovember 22, 2018 at 3:58 am #734271Harris
Managed to work out 3,4,5 and 6.
Still need help for 1 and 2 🙂November 22, 2018 at 5:37 am #734363David
StaffCustomer SupportHi there,
so just adjusting Tom’s code for #1 which is the arrow over the submenu:
.main-nav > ul > li > .sub-menu:before { content: ""; width: 0; height: 40px; border-left: 40px solid transparent; border-right: 40px solid transparent; border-bottom: 40px solid #0064a0; position: absolute; top: -60px; left: 0; pointer-events: none; }
#2 border below submenu items
#menu-main-menu .sub-menu a { border-bottom: 1px solid; }
November 22, 2018 at 6:01 am #734382Harris
Thanks David and Tom.
Both are great!
Everything working.What values do I have to adjust to enlarge the top triangle?
(I tried playing with the values with no result).November 22, 2018 at 6:16 am #734398Harris
Not sure if its right, but it works this way
.main-nav > ul > li > .sub-menu:before {
content: “”;
width: 0;
height: 30px;
border-left: 25px solid transparent;
border-right: 25px solid transparent;
border-bottom: 25px solid #0064a0;
position: absolute;
top: -50px;
left: 20px;
}November 22, 2018 at 6:19 am #734401David
StaffCustomer SupportI adjusted the code here which is probably as big as it gets before it starts interfering with the nav.
November 22, 2018 at 6:22 am #734405Harris
Thanks David!
Appart from helping, you guys are a source of learning too.Really appreciate it.
November 22, 2018 at 6:26 am #734413David
StaffCustomer SupportThats awesome – glad we can be of assistance.
February 13, 2019 at 7:38 am #809422Harris
Hello,
The 5th option of the menu (Νέα) is supposed to be a link to a page.
The link cannot be pressed though, and I think that might be a matter of the css we added in order to achieve the submenu top triangle.
Can you please drop an eye?Thanks
HarrisFebruary 13, 2019 at 7:43 am #809426David
StaffCustomer SupportI edited the code here:
https://generatepress.com/forums/topic/submenus-styling/#post-734363
Just the first CSS rule to include:
pointer-events: none;
February 13, 2019 at 7:49 am #809432Harris
Hey man! That was super quick 🙂
It works.
Thanks a lot.February 13, 2019 at 7:49 am #809434David
StaffCustomer SupportAwesome. Glad to be of help 🙂
March 19, 2019 at 10:35 pm #844066Harris
Hello,
I’m comming back to that one. In the mobile menu view, the menu items that have submenus, are not functioning (are not clickable. submenus can’t be reached).
I guess it has to do with the css we added in order to style the desktop menu.
Can you please have a look?Thanks
Harris -
AuthorPosts
- You must be logged in to reply to this topic.