Summary
Highlights
Links are popular HTML elements used to connect to other websites, other pages on your website, or various files like images and PDFs.
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.
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.
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').
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.