The Link Tag is kinda sorta similar to embedding. What it does is load a page or a file into a visitor's browser so it is ready to use.
The link tag always goes in the head of your
page
HTML: <link href="URL" rel="?">
XHTML: <link href="URL" rel="?" />
href="URL"rel="?"Use the link tag to load a page that you want to link to. The link tag will load that page in your visitor's browser so it will load very quickly when they go to it. But you should have a good reason for doing this.
What are some good reasons?Example: On your "page 1", you want to preload "page 2". Use the link tag in your head section to preload the page. Make a link to that page in your body section to go to it quickly.
(in your head secton)
<link href="page2.html" rel="next">
(in your body section)
<a href="page2.html>Page 2</a>
You just moved your website to another host. You tell everybody about it, but there are some links to your "old" URL out there. You want your visitors to be redirected to the "new" page.
Here's how:(in your head section)
<meta http-equiv="refresh" content="10;url=URL">
<link href="URL" rel="next">
(in your body)
This page has moved. If you are not redirected to the new location in 10 seconds, please go to <a href="URL">the new page</a> and update your bookmarks.
The "10" in this code is the number of seconds that pass before the redirect occurs. "URL" (the one in caps) is the URL of the page you are redirecting to.
You can also use redirect (meta refresh) to make a slide show. Just link from page to page.
You have a CSS stylesheet and you want to use it for your new page. The name of your stylesheet is "style.css".
<link href="style.css" type="text/css" rel="stylesheet" />
We'll discuss this again in our upcoming CSS lessons.
Happy coding!
Gnubee