Advertisement

How to make an underline below the menu options in the Helix template in Joomla 4?

Everything to do with Joomla! 4.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
liekecomp2022
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Mon Aug 29, 2022 10:37 am

How to make an underline below the menu options in the Helix template in Joomla 4?

Post by liekecomp2022 » Mon Apr 10, 2023 12:50 pm

Hello,

I want to change the display of the menu items in the Helix template in Joomla 4.
It should be with the purple underline below the menu options like the menu at: https://reachingautismebegeleiding.nl/

Now it is like: http://ontwikkel10.comp-it-aut.nl/

Can someone tell me how to do this?
Is it an option in the template or css code?

Thanks,

Kind regard, Lianne
Last edited by toivo on Fri Apr 14, 2023 10:34 pm, edited 1 time in total.
Reason: mod note: merged with the current topic, cross posting not allowed in forum rules, available from https://forum.joomla.org/viewtopic.php?f=8&t=65

Advertisement
liekecomp2022
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Mon Aug 29, 2022 10:37 am

How can I place the underline closer to the name of the menu items

Post by liekecomp2022 » Fri Apr 14, 2023 4:44 pm

How can I place the underline closer to the name of the menu items: https://ontwikkel10.comp-it-aut.nl/

Just like the underline at https://reachingautismebegeleiding.nl/?

I have finally found the correct css code to make the underline possible.
I placed the css in the custom code of the shaper helix ultimate template:

li > a::after {
content: "";
display: block;
margin: auto;
height: 3px;
width: 0;
top: 5px;
background: transparent;
transition: all 0.3s;

}
li > a:hover::after, li > a.active-nav::after {
width: 100%;
background: #ac84fe ;
}

davidspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Sun Jan 03, 2021 3:44 am

Re: How to make an underline below the menu options in the Helix template in Joomla 4?

Post by davidspring » Thu Apr 20, 2023 5:05 am

Here is the CSS using the Firefox inspector that should be placed in the Helix template custom.css file. To place the underline closer to the name of the menu item, change the line-height from 100px to 40px.

.sp-megamenu-parent > li:hover > a {
color: #ac83ff;
}
.sp-megamenu-parent > li > a, .sp-megamenu-parent > li > span {
display: inline-block;
padding: 0 15px;
line-height: 100px;
font-size: 14px;
margin: 0;
}

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1872
Joined: Tue Jun 30, 2020 12:17 pm

Re: How can I place the underline closer to the name of the menu items

Post by Pavel-ww » Thu Apr 20, 2023 7:02 am

liekecomp2022 wrote: Fri Apr 14, 2023 4:44 pm li > a::after {
content: "";
display: block;
margin: auto;
height: 3px;
width: 0;
top: 5px;
background: transparent;
transition: all 0.3s;

}
li > a:hover::after, li > a.active-nav::after {
width: 100%;
background: #ac84fe ;
}
Hi. This code is not entirely correct, as it affects all links in the lists on your site. I think you don't want it. Also, using ::after breaks the dropdown menu arrow on hover over and leads to some other negative effects.

Here is the correct code especially for Helix

Code: Select all

.sp-megamenu-parent>li>a::before,
.sp-megamenu-parent>li>span::before {
    content: '';
    position: absolute;
    display: block;
    bottom: 0;
    left: 0;
    background-color: #ac84fe;
    height: 5px;
    width: 0;
    transition: width .3s;
}
.sp-megamenu-parent>li:hover>a::before,
.sp-megamenu-parent>li:hover>span::before,
.sp-megamenu-parent>li.active>a::before {
    width: 100%;
}
Change bottom property value to place the underline as you want
1.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by Pavel-ww on Thu Apr 20, 2023 7:20 am, edited 2 times in total.

peterspieg
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu May 18, 2017 11:22 am

Re: How to make an underline below the menu options in the Helix template in Joomla 4?

Post by peterspieg » Wed Dec 20, 2023 1:32 pm

Hello, thanks for the css. It is working, but...
Also the active menu gets this underline. Is it possible to disable this?
I have already tried with some css, but I doesn't work. And fter spending two hours I don't see it anymore.
URL: https://www.domeintest.eu/speeltuin/

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1872
Joined: Tue Jun 30, 2020 12:17 pm

Re: How to make an underline below the menu options in the Helix template in Joomla 4?

Post by Pavel-ww » Thu Dec 21, 2023 7:48 am

peterspieg wrote: Wed Dec 20, 2023 1:32 pm Also the active menu gets this underline. Is it possible to disable this?
I have already tried with some css, but I doesn't work. And fter spending two hours I don't see it anymore.
Hi. To prevent active underline but keep active underline on hover over delete this line.
1.jpg
Or in addition to this, use CSS to prevent the underline of the active item in any conditions

Code: Select all

.sp-megamenu-parent > li.active > a::before {
	display: none;
}
You do not have the required permissions to view the files attached to this post.

Advertisement

Locked

Return to “Templates for Joomla! 4.x”