Using Html Anchor on my web site

感情迁移 提交于 2019-12-13 09:01:58

问题


I am using weebly site builder and so just a beginner on Html coding. I am having issues making anchors work on my pages. They seem to work on some systems and not others, and so I think there must be a better method.

Here is what I am doing

I have a guest author page and I want each guest, to have a direct link to his section of the web page

I set up an anchor as follows

Then use the following link to it http://arthurvaso.weebly.com/guests2016.html/#smith2

On some computers/broswers this works just fine, in others, it just goes to the Top of the page instead of the section I want.

I basically have pages I want to make direct links to

Poet1 Poet2 Poet3 etc

I search here, an all the posts were either years old, or not exactly the answer I was looking for. It seems the newer the browser version, the less my method works.

I really appreciate any help, thanks!


回答1:


There is a little trick to it, but it's an easy fix for you. You are missing   in your Anchor.

Change:

<a id="smith2"></a>


To:

<a id="smith2">&nbsp;</a>

Make sure to publish the changes.

And, note that your Anchor Link should be:
http://arthurvaso.weebly.com/guests2016.html#smith2 without the / after .html



来源:https://stackoverflow.com/questions/46656447/using-html-anchor-on-my-web-site

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