Log in

View Full Version : why this symbol used in web address?



gurmeet
11-25-2009, 06:25 AM
many a times i noticed a # sign in a web address, i dont know what its meaning in a web address? does it used for link with in a page only or it has any other meaning too?

for example
www.orkut.com/main.aspx#home

bluewalrus
11-25-2009, 06:47 AM
That says go to the section of a page, in this instance home.

Snookerman
11-25-2009, 08:13 AM
It can be used to link to an anchor on the page. For instance, maybe you have a new chapter about half-way down the page that you want to link to:

<a name="chocolate">Sweet chocolate</a>
The link to it would be http://www.example.com/index.html#chocolate or if you link from inside the page:

<a href="#chocolate">Jump to the awesome part!</a>
When the user click on either of the links, the browser window will be scrolled down to where the anchor links is.

Good luck!

boogyman
11-25-2009, 12:31 PM
It can be used to link to an anchor on the page. For instance, maybe you have a new chapter about half-way down the page that you want to link to:

<a name="chocolate">Sweet chocolate</a>
The link to it would be http://www.example.com/index.html#chocolate or if you link from inside the page:

<a href="#chocolate">Jump to the awesome part!</a>
When the user click on either of the links, the browser window will be scrolled down to where the anchor links is.

Good luck!

Pssst, should use the id attribute, not name; by doing this you are able to provide a direct link to any tag, not just the anchor tag.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>TITLE</title>
</head>
<body>

<p style="height:600px">This is some text</p>
<p id="aa">ANCHORED</p>
<p style="height:10000px">more text</p>
<p><a href="#aa">Link to ANCHORED</a></p>

</body>
</html>