Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Making Links in HTML

a normal link is

<a href="#">about us</a>

but while providing links to facebook or some other site its

<a href="www.facebook.com"</a>

does # mean a internal link within the website ???

4 Answers

If you need to support older browsers, then you can use the NAME attribute like so:

<a name="aboutus">some text here</a>
<a href="#aboutus">links to section above</a>

Please note that an A tag with just a NAME attribute will not be treated like a link by the browser unless it also has an HREF. In XHTML the ID is checked first before the NAME attribute, and in HTML5 the NAME attribute is deprecated and no longer part of the A tag.

In this link the # symbol is just a placeholder. You're putting it there because you have nothing to link to at that point. When you click it, nothing happens.

<a href="#">This is a link</a>

Here you are linking to a special section of your page, typically another element with that ID.

<a href="#id">This is a link</a>

When you're linking to your "About Us" page, the preferred way is to use relative paths:

<a href="about.html">About Us</a>

When you're linking to a site like Facebook, you must of course use the domain name:

<a href="facebook.com"><a/>

Hi Sanif, a # doesn't mean an internal link but it is used in the code as below to reference the id tag ised for internal page linking.

Example An anchor with an id inside an HTML document:

<a id="tips">Useful Tips Section</a>

Create a link to the "Useful Tips Section" inside the same document:

<a href="#tips">Visit the Useful Tips Section</a>

Read more about it here

Rgds Neill

Thanks got it !