110 likes | 180 Views
Tutorial 2. Links. Hypertext links are used to…. Point to a different section on the same page Point to a different web page Point to a variety of different web objects. Links within the same page. First we need to mark the destination text with an anchor
E N D
Tutorial 2 Links
Hypertext links are used to…. • Point to a different section on the same page • Point to a different web page • Point to a variety of different web objects
Links within the same page • First we need to mark the destination text with an anchor • This is done by putting <a href=“#name”> before the destination text, and </a> after • In this example name is the name of the anchor
Then we need to create a link, identifying the anchor that goes with this link • < a href=“#name”>Classes</a> • Now when a user clicks on this link he will be directed to the anchor and the destination text • Note that the # is NOT optional
Different Web Page Structures • Make sure you read through the different structures on pages 2.12-2.14
Linking to Another Web Page <a href= “contact.htm”>Contact me </a> produces the text “Contact me” identified as a link Clicking on this link will send the user to the page contact.htm In this example contact.htm MUST be in the same folder as the original web page
Suppose the link is on your page which is located in the folder C:\Homework, but the page you want to link to is located in C:\labwork\junk You must now create the link by writing <a href= “C:\labwork\junk\contact.htm”> Contact me </a>
Link to other documents on the internet <a href = http://www.sxu.edu> sxu’s website</a> If you want it to open in a different window: <a href=“url” target = window>hypertext</a> Window is the name of the window – it can be anything. If the windows are the same name, the pages will all open in the same window – so you get different windows by using different names
<a href = “http://www.sxu.edu/cs.html#majors”> computer science majors</a> links to an anchor called majors on the webpage called cs.html which is on sxu’s website, www.sxu.edu See page 2.29 for instructions how to create a link to an email address.
Labwork: When complete, upload all to your private directory on csmaster and email me the links. (one link per case) Complete the tutorial page 2.03- 2.22. Case 1. Case 2 Homework: Due Sat 11th Sept at midnight Case 3