Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Can you explain the issue you’re facing in more detail?
The main menu sticks at the top of the page when you scroll down in both widescreen and on the phone, in firefox, crome etc but it won´t stick when you scroll on the page with Ie & Edge
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
For me your menu doesn’t stick to the top of the page on newest Chrome, Windows 7 too. It’s just Firefox on Desktop that the menu sticks to the top.
I looked at the functionality of the JavaScript behind the menu and it won’t apply the sticky menu class if the navigation height is too tall. Maybe for some reason browsers treat spacing/ font size/ line height differently, but somewhere a difference in navigation height probably is causing the problem.
In the “Additional CSS” section of the dashboard add this:
.main-navigation a {
line-height: 1;
}
https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress
It didn’t help i even tested to set it up to 25, however i tried something else, i tested adding less letters in my menu, so the menu don’t make an linebrake and gets gets fitted in one line, that way the menu itself got shorter, that makes it work should i set the max with of the main menu so everything gets fitted so it wont make a line brake? or even if i do wont that affect the entire pages max width ?
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
should i set the max with of the main menu so everything gets fitted so it wont make a line brake?
This is much harder to achieve than making the menu fit on 1 line through reducing the letters.
An easy fix for this for me were to chance the padding its not an good way to fix it but it beat chancing the width,
i added
.main-navigation a {
padding: 1em 0.70em;
}
from 1.50em
if you guys find an better way to fix this feel free to send me a message, also Andrew thank you for guiding me to the right way !
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Great. I think it’s a matter of preference where you reduce the height. If you change your mind about the padding let us know.