I have a home page with several sections - each of them is associated with the main menu:
<body> <header> <a href="#nav" class="toggle-nav"> menu <i class="fa fa-bars"></i> </a> <nav class="main-nav" id="nav"> <a href="/#item1">Link</a> <a href="/#item2">Link</a> </nav> </header> <main> <section id="item1">some content here </section> <section id="item2">some other content here </section> </main> </body>
(possibly) appropriate css:
body { position: relative; overflow-x: hidden; } @media only screen and (max-width: 750px) { header .main-nav a { display: block; } .tiggle-nav { display: none; } }
The idea is that I should be able to click "Element 1" in the menu throughout the site and land in this section of the section.
This works very well, except on firefox mobile, where clicking on the internal anchor of the main page from any other internal page will load the home page somewhere between 100 and 200 pixels from the intended location.
Interestingly, if I refresh the page after the initial page is loaded, firefox mobile can find the internal anchor without problems - i.e. this is only a problem when switching from the internal page to the home page.
What's going on here? Is this because firefox mobile doesn't load CSS until it finds an internal anchor?
And what's important, how can I get firefox mobile to find the right location for the first time?
Any ideas are greatly appreciated.
Full css and html live at http://whoisnicoleharris.com
source share