# Linking

## Introduction

Links are the glue holding the web together, so make sure you understand how to properly link to external websites AND internal files.

## Learning outcomes

* What's the difference between internal links (/somepage) and external links (<http://www.somesite.com/somepage)?>
* When on a webpage should you use the full URI (with the `http://yoursite.com/somepath`) and when should you use the relative path (`/somepath`)?
* How do you navigate the document tree with links (../../someotherpage)?
* How do you open links in external windows?
* What are all the possible pseudo-states (e.g. `:hover`) of a link and when are they actually activated?  How do you change styles based on them?

## Assignment

1. Read [Lena Shore's explanation of the difference between absolute and relative paths](http://www.lenashore.com/2011/12/the-difference-between-absolute-and-relative-paths/).
2. Browse [Boogie Jack's article on link paths](http://www.boogiejack.com/server_paths.html).
3. Read [Six Revisions' article on link pseudo-classes](http://sixrevisions.com/css/link-pseudo-classes/).

## Additional resources

This section contains helpful links to other content. It isn't required, so consider it supplemental for if you need to dive deeper into something.

* Glance over [About.com's article on linking](http://webdesign.about.com/od/beginningtutorials/a/aa040502a.htm) if you need any additional support


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://howtocode.trek.io/topics/deep-dives/html-css/html-basics/linking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
