Linking to an id not working in Firefox - Working in Chrome/Safari

跟風遠走 提交于 2019-12-23 02:55:08

问题


I am trying to link to a specific id on another page in a rails app. The html markup that I am targeting is:

<h3 id="about">About</h3>

When I manually put localhost:3000/#about into the browser address bar, it opens up to the correct spot in the page in Chrome and Safari. But when I paste that path into Firefox, it seems to stall - it opens up midway through the first page. Then if I hit enter on my keyboard again in the address bar, it goes to the correct spot.

Any ideas what may be causing this? Curious if I am following the correct conventions and have already taken a look at this excellent post - HTML Anchors with 'name' or 'id'?.

Any suggestions or ideas would be appreciated! Thanks


回答1:


Try exactly anchors thats given below and tell me if its working or not.

 <div class="one">   <a href="#details">Click Here To Go There</a> </div>

 <div class="two">   <a name="details">There</a> </div>

You have to position the div classes accordingly.



来源:https://stackoverflow.com/questions/15551621/linking-to-an-id-not-working-in-firefox-working-in-chrome-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!