HTML Hyperlink between and within pages

时间:2022-06-22 16:31:28

In HTML, we can use tag <a href=""> to create hyperlinks between and within pages. The difference is just that, if it's with the prefix '#', it is a link within this page, else it is a link to another page.

link to a web page

This is a link to my blog:

<a href="http://xiang-jiang.blogspot.com/">Xiang-Jiang</a>

It works out like this:

Xiang-Jiang

link within a page

We can use the attribute "id" to create link within a page.

Here is an example:

<a id="bigjump">jump to here</a>

<a href="#bigjump">let's jump</a>

It worked out like this:

jump to here 
xxxxxxxxx 
let's jump