150 likes | 271 Views
HTML links. A hyperlink (or link) is a word, group of words, or image that you can click on to jump to a new section within the current document, or a new document, or to another website. When you move the cursor over a link, the arrow will turn into a little hand.
E N D
HTML links • A hyperlink (or link) is a word, group of words, or image that you can click on to jump to a new section within the current document, or a new document, or to another website. • When you move the cursor over a link, the arrow will turn into a little hand. • The link is displayed as blue underlined text. • These other locations are called targets.
HTML links • A link is specified usinganchor tags: <a></a> • Anything between the opening < a > tag and the closing < /a > tag becomes part of the link that users can click in a browser
HTML links • To link to another web page, the opening < a > tag must carry an attribute called href ; the value of the href attribute is the name of the file you are linking to • href means “hypertext reference” • This attribute tells the browser where to find a link
HTML links within the same folder • A link to a web page within the same folderof the website would look like this: <a href="filename.html">text to be clicked</a>
<a href="filename.html">text to be clicked</a> • The href attribute contains the file name of the destination web page • The file name is enclosed in quotation marks and it includes the .html extension • The text between the opening and closing a tag is the link you will click • To keep things simple, for now place all your web pages in the same folder
Linking to another website • Linking to another website is done by putting the entire website address (url) into the href attribute: <a href="http://www.siteaddress.com">text to be clicked here</a> • Be sure that http:// is included in the website address
Link syntax: <a href="filename.html">text to be clicked</a> <a href=”http://www.google.com”>This is a link </a> - Attributes: target and name
Example of Bookmark • <p><a href = "#top">Back to the top</a>