Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

css - Using Html Anchor on my web site

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...