Summary
Highlights
Introduction to Links in HTML00: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 Link00: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 Tab00: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 Website00: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 Website00: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.