Soona Posted September 20, 2022 Share Posted September 20, 2022 Site URL: https://www.lucienandsolenn.com/ Hello there! I know that there is some post about this, and I found a good code for it . However, I cannot find a way to "stop the line" under the drop down menu links and make it 100% of the word, not beyond. How can I do? I post the picture of it below. Thank you in advance! My website password : Forthesakeoflove Here is the css code : .header-nav-item > a:after, .header-nav-folder-item > a:after { content:''; width: 0px; height: 1px; background: #fff; display: block; transition: width .2s ease; } .header-nav-item > a, .header-nav-folder-item:hover { background: none !important; } .header-nav-item--active > a:after, .header-nav-item:hover > a:after, .header-nav-folder-item:hover > a:after { width: 100%; } .header-nav-folder-item:hover > a { color: #fff !important; } urbnthstl24 and JamIsJam88 2 Link to comment
Beyondspace Posted September 20, 2022 Share Posted September 20, 2022 3 hours ago, Soona said: Site URL: https://www.lucienandsolenn.com/ Hello there! I know that there is some post about this, and I found a good code for it . However, I cannot find a way to "stop the line" under the drop down menu links and make it 100% of the word, not beyond. How can I do? I post the picture of it below. Thank you in advance! My website password : Forthesakeoflove Here is the css code : .header-nav-item > a:after, .header-nav-folder-item > a:after { content:''; width: 0px; height: 1px; background: #fff; display: block; transition: width .2s ease; } .header-nav-item > a, .header-nav-folder-item:hover { background: none !important; } .header-nav-item--active > a:after, .header-nav-item:hover > a:after, .header-nav-folder-item:hover > a:after { width: 100%; } .header-nav-folder-item:hover > a { color: #fff !important; } Do you mean something like this? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Beyondspace Posted September 20, 2022 Share Posted September 20, 2022 (edited) I try the following code and it seems fine .header-nav-folder-item > a { display: inline-block; } Let me know how it works on your site Support me by pressing 👍 if this useful for you Edited September 20, 2022 by bangank36 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Soona Posted September 21, 2022 Author Share Posted September 21, 2022 Yes that's perfect! thank you it was actually easier than I thought 😉 thank you very much! Link to comment
JamIsJam88 Posted February 19 Share Posted February 19 How can I make this work for mobile menu? I have a forced mobile menu on desktop. I tried this code, but the underline animation is across the entire screen. .header-menu-nav-item > a:after, .header-menu-nav-folder-item > a:after { content:''; width: 0px; height: 1px; background: #443A31; display: block; transition: width .5s ease; } .header-menu-nav-item > a, .header-menu-nav-folder-item:hover { background: none !important; } .header-menu-nav-item--active > a:after, .header-menu-nav-item:hover > a:after, .header-menu-nav-folder-item:hover > a:after { width: 100%; } .header-menu-nav-folder-item:hover > a { color: #443A31 !important; } body:not(.header--menu-open) .header-menu-nav-item--active>a { background-position: 0 calc(~"100% + 1px") !important; } Link to comment
tuanphan Posted February 20 Share Posted February 20 On 2/19/2024 at 12:28 PM, JamIsJam88 said: How can I make this work for mobile menu? I have a forced mobile menu on desktop. I tried this code, but the underline animation is across the entire screen. .header-menu-nav-item > a:after, .header-menu-nav-folder-item > a:after { content:''; width: 0px; height: 1px; background: #443A31; display: block; transition: width .5s ease; } .header-menu-nav-item > a, .header-menu-nav-folder-item:hover { background: none !important; } .header-menu-nav-item--active > a:after, .header-menu-nav-item:hover > a:after, .header-menu-nav-folder-item:hover > a:after { width: 100%; } .header-menu-nav-folder-item:hover > a { color: #443A31 !important; } body:not(.header--menu-open) .header-menu-nav-item--active>a { background-position: 0 calc(~"100% + 1px") !important; } You can share link to site where you have problem, we can check easier 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!) Link to comment
JamIsJam88 Posted February 22 Share Posted February 22 On 2/20/2024 at 3:52 AM, tuanphan said: You can share link to site where you have problem, we can check easier I was actually able to solve this. Here is the code if anyone else needs a solution. .header-menu-nav-item>a:hover { color: #443A31 !important; font-style: italic; } @media only screen and (min-width:768px) { .header-menu-nav-item > a:after, .header-menu-nav-folder-item > a:after { content:''; width: 0px; height: 1px; background: #443A31; display: block; transition: width 1s ease; } } @media only screen and (max-width:767px) { .header-menu-nav-item > a:after, .header-menu-nav-folder-item > a:after { content:''; width: 0px; height: 1px; background: #443A31; display: block; transition: width 0.25s ease; } } .header-menu-nav-item > a, .header-menu-nav-folder-item:hover { background: none !important; } .header-menu-nav-item--active > a:after, .header-menu-nav-item:hover > a:after, .header-menu-nav-folder-item:hover > a:after { width: 100%; } .header-menu-nav-folder-item:hover > a { color: #443A31 !important; } body:not(.header--menu-open) .header-menu-nav-item--active>a { background-position: 0 calc(~"100% + 1px") !important; } .header-menu-nav-item a { display: inline-block !important; } .header-menu-nav-item { text-align: right; } tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment