Soona Posted September 20, 2022 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
Beyondspace Posted September 20, 2022 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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
Beyondspace Posted September 20, 2022 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 (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
Soona Posted September 21, 2022 Author Posted September 21, 2022 Yes that's perfect! thank you it was actually easier than I thought 😉 thank you very much!
JamIsJam88 Posted February 19 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; }
tuanphan Posted February 20 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!)
JamIsJam88 Posted February 22 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment