Links and attributes
Target, rel, and downloads
Decide when a link should open a new tab, describe its relationship, or suggest downloading a resource instead of navigating to it.
Links normally open in the current tab. That is a good default. The visitor keeps control of their browsing history and the back button keeps working as they expect.
Sometimes a new tab is genuinely useful. For example, you link to an external report and you do not want the reader to lose their place on your page. In that case, use target="_blank":
<a
href="https://example.com/report/"
target="_blank"
rel="noopener"
>
Open the external report in a new tab
</a>
Click the link and a second tab opens while your page stays open in the first. The rel attribute describes the relationship between the current page and the destination. noopener prevents the new page from getting access to the page that opened it in older browser behavior. Modern browsers generally apply similar protection for _blank links automatically, but stating rel="noopener" is harmless and makes your intent explicit.
Opening a new tab can surprise people. If you do it, say so in the link text or in nearby context. Do not open new tabs silently.
The download attribute suggests downloading a same-origin file instead of navigating to it:
<a href="/files/route-map.pdf" download>Download the route map</a>
The browser and server still have the final say. Cross-origin links may ignore download, and response headers like Content-Disposition can override what the browser does. Treat download as a hint, not a guarantee.
On your my-page project, link to one external site with target="_blank" and clear link text that mentions a new tab. For a PDF or file you host in the same folder, try download and confirm whether the browser saves the file or opens it. That behavior varies by browser and file type.
Either way, the visitor should know what the link will do before they click it.
Quick check
Result
You got of right.
Lesson completed