More on Hyperlinks and the Web
Anatomy of a URL
https://
musicforprogramming.net/
latest/
- https://
- HyperText Transfer Protocol
- Client is requesting a hypertext file from the server
- musicforprogramming.net/
- Domain Name
- Rerouts to an IP address, actual "location" of the server on the internet
- latest/
- pathname to the file that the client is specifically requesting
- If the server has it, it will send the file through the internet to the client who will then be able to view the document!
Anatomy of an HTML hyperlink (anchor)
<a
href="musicforprogramming.net/listen" target="_blank"
>
This is a link!
</a>
- <a> ... </a>
- HTML anchor element
- Creates a hyperlink to a specified destination
- href="musicforprogramming.net/"
- Hyperlink Reference (href)
- Provides a destination for the link (presuming such a URL exists!)
- target="_blank"
- Additional attribute for the anchor elemnent
- Specifically opens link in a new tab rahter than moving from your current page
- This is a link!
- What renders on the page to serve as the link
- This could be text, an image, or any inline element
This is a link!
Types of Hyperlinks
- Bookmark/Skip Link: takes you to a specified place on the current document
- Internal Link: takes you to a specificed destination on the current website/domain, but possibly a different page/document
- External Link: takes you to a specified destination on a different domain
Things Hyperlinks can link to
- HTTP(S)
- Tel: Telephone Number
- mailto: email address
- SMS: text message
- JavaScript: execute functions
Lets go home!