LucieGbt1993 Posted November 20 Posted November 20 Site URL: https://oriole-oarfish-95cc.squarespace.com/ Hi, Using site-wide animation -> With the "flex" animation, I've noticed that the header navigation links get a nice effect : when hovering a link, an underlining effect appears with a slight animation of apparition. I would like to use the "Slide" effect (and not the flex animation). How can I please reproduce the same hover effect on my animation links? Password : clublulu2024 Thanking you very much in advance, Lucie
Spark-Plugin Posted November 21 Posted November 21 Hi @LucieGbt1993 To achieve this, you’ll need to use a custom code. Here it is: Navigate to Pages > Website Tools > Custom CSS. Paste the code into the CSS editor. Hit Save and you’re done /* Navigation link underline animation */ .header-nav-item > a:after { content: ''; /* Creates a pseudo-element for the underline */ width: 0px; /* Initial width of the underline */ height: 1px; /* Thickness of the underline */ background: #000; /* Underline color */ display: block; /* Ensures it behaves like a block element */ transition: width 0.2s ease; /* Smooth animation for the width change */ } /* Removes background from active or hovered links */ .header-nav-item > a, .header-nav-folder-item:hover { background: none !important; /* Ensures no background is applied */ } /* Active or hover state for main navigation links */ .header-nav-item--active > a:after, .header-nav-item:hover > a:after, .header-nav-folder-item:hover > a:after { width: 100% !important; /* Expands the underline to the full width of the link */ } /* Folder item underline animation */ .header-nav-folder-item > a:after { content: ''; /* Creates a pseudo-element for folder links */ width: 0px; /* Initial width of the underline */ height: 1px; /* Thickness of the underline */ background: #000; /* Underline color */ display: block; /* Ensures it behaves like a block element */ transition: width 0.2s ease; /* Smooth animation for the width change */ } Hope it helps. - Answered by Iuno from sparkplugin.com
LucieGbt1993 Posted November 22 Author Posted November 22 Hi, Thanks so much, it worked perfectly. The only remaining problem is that on the secondary navigation menu (dropdown menu navigation links), the underlining effects fits the dropdown menu container and not the actual navigation link. How can this be fixed please? See screenshot attached. Thanking you very much for your help, Lucie
Solution tuanphan Posted November 25 Solution Posted November 25 On 11/22/2024 at 3:40 PM, LucieGbt1993 said: Hi, Thanks so much, it worked perfectly. The only remaining problem is that on the secondary navigation menu (dropdown menu navigation links), the underlining effects fits the dropdown menu container and not the actual navigation link. How can this be fixed please? See screenshot attached. Thanking you very much for your help, Lucie You can use extra CSS code div.header-nav-folder-content a { display: inline-block; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
LucieGbt1993 Posted November 26 Author Posted November 26 Perfect, thank you very much for your help🙏
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment