HTML links are hyperlinks. A hyperlink is a text or an image you can click on, and jump to another document.
<a href="url">link text</a>
HTML links are defined with the
tag. The link address is specified in the
attribute. Use links to: 1 jump from section to section within the same web page 2 link to a different page within your own website 3 link to another web page or website anywhere in the world There are different ways to provide these links. 1 clicking on a word, phrase or sentence 2 clicking on a button 3 clicking on an image
To jump within a page you need:
1 The command that points or sends the browser to another section on your web page. 2 The place or point on the page where you want the browser to jump to. You can think of page jumps as bookmarks. Make a marker like: <h2
>Top of page!</h2> You can put this marker anywhere between the body tags, but in this case i put i in the very top while its supposed to be link to the top of the page... ...and then do this: <a href="
>Go to top</a> ...thats basically what is done with the blue arrow below: <a href="#top"><img alt="x" src="images/up.jpg" ></a> ...i just used an image link instead. x
Linking to other pages within your own website is easy to do.
If you have a startpage called index.html and a second page called second.html and you want to make a link from the second page back to your starpage you type this: <a href="index.html">Click on these words</a>
To link to pages outside your own website you type this:
<a title="yahoo" href="" alt="HTML" >Click here to go to yahoo.</a> Click here to go to yahoo.
A means anchor
and starts the link to another page.
stands for hypertext reference. is the address
of the link. The address has an equal sign in front of it and is enclosed in quotes because it's an attribute of the anchor tag. Click here to go to yahoo is what appears on the page for the viewer to click.
ends the entire link command. URL stands for Uniform Resource Locator, and is used to specify addresses on the World Wide Web. A URL is the fundamental network identification for any resource connected to the web (e.g., hypertext pages, images, and sound files). The example above used an
absolute URL
(A full web address). A local link (link to the same web site) is specified with a
relative URL
(without http://www....): <a href="indexht.html"> Html home </a> Html home
Image link:
<a href="indexht.html"><img src="images/tibet.jpg" style="width:100px;height:100px;" alt="tibet" ></a>
Click me
By default, links will appear as follows in all browsers: An unvisited link is underlined and blue A visited link is underlined and purple An active link is underlined and red A linked page is displayed in the current browser window, unless you specify another target.
To style links use CSS:
<a href="indexht.html"> <img src="images/tibet.jpg" alt="HTML tutorial"
style="width:100px;height:100px; border-style: solid; border-width: 5px; border-color: #ff0000 #0000ff;
"> </a> tibet
Button link:
<form method="get" action="indexc++.html"> <button type="submit">C++ Home</button> </form>
Download link:
<a href="../downloads\" target="_blank">Download</a>
HTML Links - The target Attribute
<a href="indexht.html" target="_blank">Html home</a> Target Value Description _blank Opens the linked document in a new window or tab _self Opens the linked document in the same frame as it was clicked (this is default) _parent Opens the linked document in the parent frame _top Opens the linked document in the full body of the window framename Opens the linked document in a named frame If your webpage is locked in a frame, you can use target="_top" to break out of the frame