Links | HTML | Tutorial 8

Share

Summary

This tutorial explains how to use links in HTML. It covers creating external links, linking to other pages within a website, and linking to various files like images or PDFs. The video also demonstrates how to control whether a link opens in the same tab or a new tab.

Highlights

Introduction to Links in HTML
00:00:00

Links are popular HTML elements used to connect to other websites, other pages on your website, or various files like images and PDFs.

Creating an External Link
00:00:40

To create a link, use the 'a' HTML tag with an 'href' attribute. The 'href' specifies the destination URL. For external links, include the full address, including 'http://' or 'https://'. The text or other HTML elements placed between the opening and closing 'a' tags will become the clickable link content.

Opening Links in a New Tab
00:02:51

By default, clicking an external link navigates away from your current page. To open a link in a new tab, add the 'target="_blank"' attribute to the 'a' tag.

Linking to Other Pages on Your Website
00:04:14

You can link to other HTML pages within your website using relative URLs in the 'href' attribute. If the pages are in the same directory, just use the filename. If a page is in a subdirectory, specify the directory name followed by a forward slash and the filename (e.g., 'dir1/page3.html').

Linking to Files on Your Website
00:07:12

Links can also be used to access files stored on your website, such as images (e.g., 'cat.jpg') or PDF documents. The process is similar to linking to other HTML pages using relative paths.

Recently Summarized Articles

Loading...