0

I'm trying to create a menu and some sections but when the site loads I want to hide the menu. I want to do this with a redirect to the first section. I know this can be done in java script but its not allowed.

I have used the refresh meta tag but its giving me a seizure from it looping. I've change "0" out with other numbers but the same thing happens. There is also enough to scroll to hide the menu.

<meta http-equiv="refresh" content="0; url=#home" />
 <nav>
  <a href="#">Home</a>
  <a href="#">News</a>
  <a href="#">Blog</a>
  <a href="#">Contact</a>
 </nav>
<section id="home">
 <p>Hello World!</p>
</section>

I need it to redirect to the first section hiding the menu.

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • I can't think of any way to do this with a meta tag alone. Why is JavaScript not allowed? – j08691 May 06 '19 at 14:26
  • Definitely cannot use meta refresh since it will just keep refreshing the page. If you want to access the page and scroll to #home then put #home at the end of the url or use js to scroll programmatically – Huangism May 06 '19 at 14:30
  • @j08691 thanks for letting me know. I really wanted to avoid JavaScript if I could. – Adam Wilcox May 06 '19 at 14:34
  • 1
    @AmirBll Please read https://meta.stackoverflow.com/questions/254990/when-should-code-formatting-be-used-for-non-code-text/254995#254995 and https://meta.stackoverflow.com/questions/327171/user-adding-excessive-bolding-in-otherwise-good-edits - that edit is NOT considered good. – Zoe May 06 '19 at 14:35
  • @Huangism okay darn. I guess I should delete this post lol. Is there a simple JavaScript way where it does this with as little code possible? Another post? – Adam Wilcox May 06 '19 at 14:37
  • @AdamWilcox lot of different ways to do this, you can checkout the answers here https://stackoverflow.com/questions/3163615/how-to-scroll-html-page-to-given-anchor – Huangism May 06 '19 at 14:42
  • @Zoe Thanks for your guidance. – AmirBll May 06 '19 at 14:47

0 Answers0