Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, HTML Links in HTML / XHTML; HTML Links The Anchor Tag and the Href Attribute HTML uses the <a> (anchor) tag to create a link to ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=5557


Reply
 
 
The God Father
Developer's Avatar

Reply With Quote
Thanks: 1
Thanked 213 Times in 154 Posts
 
Join Date: Jul 2008
Location: NDC
Posts: 5,426
28-10-2008, 05:52 PM
 
HTML Links


The Anchor Tag and the Href Attribute

HTML uses the <a> (anchor) tag to create a link to another document.
An anchor can point to any resource on the Web: an HTML page, an image, a sound file, a movie, etc.
The syntax of creating an anchor:
<a href="url">Text to be displayed</a> The <a> tag is used to create an anchor to link from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink.
This anchor defines a link to W3Schools:
<a href="http://www.egypt.com/">Visit Egypt!</a> The line above will look like this in a browser:
visit Egypt !

The Target Attribute

With the target attribute, you can define where the linked document will be opened.
The line below will open the document in a new browser window:
<a href="http://www.egypt.com/"
rel="nofollow" target="_blank">Visit egypt!</a>
The Anchor Tag and the Name Attribute

The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page, instead of letting the user scroll around to find what he/she is looking for.
Below is the syntax of a named anchor:
<a name="label">Text to be displayed</a> The name attribute is used to create a named anchor. The name of the anchor can be any text you care to use.
The line below defines a named anchor:
<a name="tips">Useful Tips Section</a> You should notice that a named anchor is not displayed in a special way.
To link directly to the "tips" section, add a # sign and the name of the anchor to the end of a URL, like this:
<a href="http://www.egypt.com/html_links.asp#tips">
Jump to the Useful Tips Section</a> A hyperlink to the Useful Tips Section from WITHIN the file "html_links.asp" will look like this:
<a href="#tips">Jump to the Useful Tips Section</a>
Basic Notes - Useful Tips

Always add a trailing slash to subfolder references. If you link like this: href="http://www.egypt.com/html", you will generate two HTTP requests to the server, because the server will add a slash to the address and create a new request like this: href="http://www.egypt.com/html/"
Named anchors are often used to create "table of contents" at the beginning of a large document. Each chapter within the document is given a named anchor, and links to each of these anchors are put at the top of the document.
If a browser cannot find a named anchor that has been specified, it goes to the top of the document. No error occurs.
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, HTML Links in HTML / XHTML; HTML Links The Anchor Tag and the Href Attribute HTML uses the <a> (anchor) tag to create a link to ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=5557


Bookmarks

Tags
html, links


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson : HTML Linking to E-Mail in HTML Tutorial Developer Articles 0 17-10-2008 08:14 PM
Links Grabber Developer Software and Programs 0 01-10-2008 12:39 AM
Sponsored Links Developer Mods for 3.7.x 0 14-09-2008 12:32 AM
Adding links in the nav bar Developer Mods for 3.7.x 0 12-09-2008 03:44 AM
Websites You Should Be Getting Links From Developer Search Engine Optimization (SEO) 0 11-09-2008 05:42 PM